In lessons on continuous functions, such problems (logical jokes?) tend to be common. They are constructed to test the student's understanding of the definition of continuity. Such functions have a very brief lifetime however. After the lesson on continuous functions, the student will never see their like again.