There exists a function that is continuous on the irrationals and discontinuous on the rationals, for example, the function where is the denominator of when written in lowest terms.
Does there exist a function that is continuous on the rationals and discontinuous on the irrationals? This would seem harder- as the rationals are a much smaller set than the irrationals.
In fact, we show that no function can be continuous only on a countable dense set of , such as . The main idea is that if the set of continuity points were countable, then we could choose a nested sequence of intervals around points of where the variation in goes to 0, that eventually avoids all points of . But the common point of the intervals would be a continuity point, contradiction.
Suppose by way of contradiction that is a function with a countable set of continuity points . Let be any positive sequence converging to 0. By continuity at , we can choose a nondegenerate closed interval around such that for all . (By definition we can choose an open interval, but every open interval contains a closed one.) Now define nested intervals inductively as follows: once has been defined, if let , and if let be an interval around that is contained in , does not contain , and such that whenever . Note that each avoids ; therefore contains no continuity point. However, as a series of nested intervals it contains a point .
We can continue our construction forever- we cannot have since the set of continuity points is dense. We show is a continuity point. Given we can choose so that and . Now so for any , imply that
Since there is an interval around where differs from by at most , is a continuity point not in our list , contradiction.