4

The famous Thomae's function provides an example which is continuous only on irrationals. Similarly, can we have a function which is continuous only on rationals and nowhere else?

2 Answers2

2

No, by the Baire category theorem. The set of continuity is a $G_\delta$.

Robert Israel
  • 448,999
1

No.

The Wikipedia article on Thomae's function gives an elegant proof of why this is impossible. It includes links to terms it uses. I'll present what it says here but I suggest you view it on Wikipedia.

A natural follow-up question one might ask is if there is a function which is continuous on the rational numbers and discontinuous on the irrational numbers.

This turns out to be impossible; the set of discontinuities of any function must be an Fσ set. If such a function existed, then the irrationals would be an Fσ set and hence, as they don't contain an interval, would also be a meager set.

It would follow that the real numbers, being a union of the irrationals and the rationals (which is evidently meager), would also be a meager set. This would contradict the Baire category theorem.