1. ## Continuity mk4

I just want to make sure i'm doing these correctly.

Prove that $\displaystyle f(x)=\begin{cases}x \ \ \ \ \ x \ \ rational\\ x^2 \ \ \ \ x \ irrational \end{cases}$ is continuous at 0.
I need to find $\displaystyle |f(x)-f(x_0)|<\epsilon$ when $\displaystyle 0<|x-x_0|<\delta$.
Let $\displaystyle x_0=0$ (since i'm interested in continuity at the origin).
Therefore I need to find $\displaystyle |f(x)|<\epsilon$ when $\displaystyle 0<|x|<\delta$.

Let $\displaystyle 0<\delta<1$.
$\displaystyle |f(x)|<\epsilon \Leftrightarrow \ |x|<\epsilon$ for $\displaystyle x \in \mathbb{Q}$.
$\displaystyle |f(x)|<\epsilon \Leftrightarrow \ |x^2|<\epsilon \Leftrightarrow |x|< \epsilon$ (since $\displaystyle |x^2| \leq |x|$) for $\displaystyle x \in \mathbb{R}$\$\displaystyle \mathbb{Q}$.

Therefore pick $\displaystyle \delta$ such that $\displaystyle \delta=min\{\frac{1}{2}, \epsilon \}$.

That's the preliminary work done, so here's the proof.

Let $\displaystyle \epsilon>0$ and define $\displaystyle \delta:=min\{\frac{1}{2}, \epsilon \}.$ When $\displaystyle 0<|x|< \delta$:

$\displaystyle |f(x)|=|x|< \epsilon$ for $\displaystyle x \in \mathbb{Q}$
$\displaystyle |f(x)|=|x^2|<|x|<\epsilon$ for $\displaystyle x \in \mathbb{R}$\$\displaystyle \mathbb{Q}$

My one issue is that the method i've used is extremely similar to a method someone showed me how to use for another question. I also haven't used the properties of rational and irrational numbers as I would have liked.

Is this right?

2. You are simply over-thinking this problem.
In any $\displaystyle \varepsilon-$region of zero the numbers are themselves near zero.
So if $\displaystyle \varepsilon > 0 \text{ set }\delta = \varepsilon$.
Doing that simple step solves this problem.

$\displaystyle \varepsilon > 0\;\& \,\delta = \varepsilon \, \Rightarrow \left[ {\,\left| {x - 0} \right| < \delta \, \Rightarrow \,\left| {x - 0} \right| < \varepsilon } \right]$