Real Analysis – Continuity for Rational and Irrational Numbers

proof-verificationreal-analysis

Let $h(x) = x$ for all rational numbers $x$ and $h(x) = 0$ for irrational numbers. I'm trying to show that $h$ is continuous at $x=0$ and at no any other point.

Defintion of continuity at $x_0$: $(\forall x)(\forall \varepsilon > 0)(\exists \delta > 0)$ such that $|x-x_0| < \delta \implies |h(x) – h(x_0)| < \varepsilon$.

For this part of the question I took $\delta = \epsilon$. Then $|x – 0| < \delta \implies |h(x)| < \varepsilon$ because if $x$ is rational, then $x < \varepsilon$ and if $x$ is irrational then $|x| < \varepsilon$.

Defintion of discontinuity at $x_0$: $(\exists x)(\exists \varepsilon > 0)(\forall \delta > 0)$ such that $|x-x_0| < \delta \implies |h(x) – h(x_0)| \geq \varepsilon$.

I tried to divide the problem into two cases:

1) If $x_0$ is rational, then $|h(x) – h(x_0)| = |h(x) – x_0|$. Then pick $x$ to be a irrational number. Then I have $|h(x) – x_0| = |x_0|$. And take $\varepsilon = \frac{|x_0|}{2}$.

2) Now if $x_0$ is irrational $|h(x) – h(x_0)| = |h(x)|$. Now here is where I was unsure of myself: If I pick $x$ to be a rational number, then $|h(x)| = |x|$. I was not sure about choosing $\varepsilon$ so that $|x| \geq \varepsilon$. Would it be valid to take $\varepsilon = \frac{|x|}{2}$? (I mean $|x|$ here and not $|x_0|$)

Could I get some feedback? Thanks!

Edit
To finish off the last part, let $\varepsilon = \frac{|x_0|}{2}$. Now I want to choose an $x$ in the rational numbers. I also need to satisfy $x_0 – \delta < x$ (since $|x_0 – x| < \delta$) and $|x| \geq \frac{|x_0|}{2}$. So now I pick $x \in (|x_0|-\delta, |x_0|) \cap (\frac{|x_0|}{2}, |x_0|)$.

Best Answer

No you can't take $\varepsilon = \frac{|x|}{2}$, since it is not constant.

But you can still take $\varepsilon = \frac{x_0}{2}$, because for any $\delta>0$ you will find $x$ such that $|x - x_0|< \delta$, but $h(x) > \varepsilon$ (for positive $x_0$ such $x$ is any rational number between $x_0$ and either $x_0 - \delta$ or $x_0 - \epsilon$, whichever is bigger; similarly for negative $x_0$).

Related Question