Continuity of a Single Point My problem is :Find the points at which the the mentioned function is continuous
$$f(x) = \begin{cases} x & \text{if $x$ is a Rational Number}
                   \\ -x & \text{if $x$ is not a Rational Number} 
\end{cases}$$
I was asked to learn that this function is continuous at $x = 0$ and the LHL and RHL were equated as follows
LHL
$$ \lim_{h \to 0} f(0 - h) = \lim_{h \to 0}-(0 - h) = 0$$
, 
RHL
$$ \lim_{h \to 0} f(0 + h) = \lim_{h \to 0}-(0 + h) = 0$$
and
$$f(0) = 0$$
Now since
$$ LHL = RHL = f(0)$$
Therefore the function is continuous.
My question is why are we taking a point just before Zero to be Irrational.
In my opinion it could be Rational as well as Irrational making the function oscillatory and hence making it discontinuous.Please help.
I possible please state your educational qualifications(It will help me when I discuss the solution with my teacher).
 A: The given argument is no proof: it's only a complicated way to show the rather obvious fact that $x\mapsto -x$ is continuous at $0$.
What you want is showing that $\lim_{x\to0}f(x)=0$ and this follows easily from the fact that
$$
-|x|\le f(x)\le |x|
$$
for all $x$.
Apply the squeeze theorem.
No squeeze theorem? Then let's go with the definitions.
Let $\varepsilon>0$; if $0<|x-0|<\varepsilon$, then $|f(x)-0|=|f(x)|=|x|<\varepsilon$. So taking $\delta=\varepsilon$ ends the argument.
A: Limit value should be same irrespective of the way x approaches a (=0 in this case). Here it is totally incorrect to apply RHL and LHL.
Correct way would be as follows: To ensure continuity at 0 we should have lim x tends to 0, such that x belongs to rational f(x)= lim x tends to 0, such that x belongs to irrational f(x)= f(0). Note that we can do this since we can always find a rational as well as irrational number AS CLOSE to any number (0 here) AS WE PLEASE.
So, lim x tends to 0, such that x belongs to rational x= lim x tends to 0, such that x belongs to irrational -x= f(0) Or 0= -0= 0 which is clearly true. Hence     proved.
