1. ## Continuity mk4

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

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

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

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

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

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

$|f(x)|=|x|< \epsilon$ for $x \in \mathbb{Q}$
$|f(x)|=|x^2|<|x|<\epsilon$ for $x \in \mathbb{R}$\ $\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 $\varepsilon-$region of zero the numbers are themselves near zero.
So if $\varepsilon > 0 \text{ set }\delta = \varepsilon$.
Doing that simple step solves this problem.

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