Proof for continuity of $h(x) = \begin{cases} x, & x\in\mathbb{Q} \\ -x, & x\notin\mathbb{Q} \end{cases}$

112 Views Asked by At

I have the given function and I have to find out, where it is continuous and discontinuous...

My guess is, that the function is discontinuous on all $\mathbb{R}\setminus{0}$ and continuous in $0$. Could you look over my proof and give me a feedback?

Proof:

For $x\in\mathbb{Q}$ look at the sequence $(q_n)$, which converges to $x$. The sequence $(h(q_n))$ is then equal to the sequence $(q_n)$ and therefore converges to $x$, so we can conclude: $\lim_{n->\infty}h(q_n))=h(\lim_{n->\infty}q_n)=h(x)=x$

For $x\notin\mathbb{Q}$ look at the sequence $(r_n)$, which converges to $x$. The sequence $(h(r_n))$ is then equal to the sequence $-(r_n)$ and therefore converges to $-x$, so we can conclude: $\lim_{n->\infty}h(r_n))=x\neq-x=h(\lim_{n->\infty}-r_n)$

Therefore $h$ can't be continuous (I don't know the exact theorem name, but the subsequences of a function has to have the limit $h(x_0)$, if $h(x)$ is continuous in $x_0$

So the function is only continuous in $x=0$. Proof:

Let $\epsilon>0$ and $\delta =\epsilon$, then we have: $\forall \epsilon>0 \exists \delta > 0 \forall x\in \mathbb{R} : |x-x_0|=|x-0|<\delta =\epsilon \Rightarrow |h(x)-h(x_0)|=|h(x)-x_0|=|h(x)|=|x|<\epsilon$

We can conclude, that the function is continuous in 0 and discontinuous for every $\mathbb{R} \setminus 0$