# Prove the function $f:[0,2]\to \mathbb{R}$ is continous at $c=1$.

Please verify my proof for the following claim.

Define $$f$$ on $$[0,2]$$ by $$\displaystyle{f(x) = \begin{cases} x & \textrm{ if } x \in \mathbb{Q} \\ 2-x & \textrm{ if } x \in [0,2]\backslash \mathbb{Q}. \end{cases}}$$.

Claim. $$f$$ is continuous at $$c=1$$.

Proof. Let $$\epsilon >0$$. Choose $$\delta = \epsilon$$. If $$x\in [0,2]$$, then $$x\in [0,2]\cap \mathbb{Q}$$ or $$x\in [0,2]\setminus \mathbb{Q}$$. If $$x\in [0,2]\cap \mathbb{Q}$$ and $$|x-1|<\delta$$, then $$|f(x) - f(1)| = |x - 1| < \delta = \epsilon.$$ Otherwise, if $$x \in [0,2]\setminus\mathbb{Q}$$ and $$|x-1|<\delta$$, then $$|f(x) - f(1)| = |2-x - 1| = |1-x| = |x-1| < \delta = \epsilon.$$ This proves that $$f$$ is continuous at $$c=1$$.

• You can also try by sequential criteria of continuous function. – neelkanth Nov 3 '18 at 3:25