Ok. This question may sound very easy, but actually I am in great need of an answer. I have been facing trouble in constructing functions, which are only continuous at some particular sets.
For example, the standard example of a function which is only continuous at one point, is the function, $f(x) = x, \ x \in \mathbb{Q}$ and $f(x) = -x, x \in \mathbb{R} \setminus \mathbb{Q}$. Similarly, I would like to know how to construct a function which is:
Continuous at exactly $2,3,4$ points.
Continuous exactly at integers
Continuous exactly at Natural numbers
Continuous exactly at Rationals.
I would like to see many examples (with proof!), so that I won't struggle when somebody asks me to construct such functions.