How to check the continuity of function
f(x) = x when x is rational
2-x when x is irrational
Any function $\displaystyle y=f(x)$ is continuous at point $\displaystyle x=a$ if the following three conditions are satisfied :
1)$\displaystyle f(a)$ is defined.
2)$\displaystyle \lim_{x \to a}f(x)$ exists i.e is finite.
3)$\displaystyle \lim_{x \to a}f(x)=f(a)$
And, of course, there exist both rational and irrational numbers arbitrarily close to any number. So you can take the limit at any number by a sequence of rational numbers or a sequence of irrational numbers. I think you will find that this function is continuous at exactly one value of x. What is that value of x?