$f(x)=\begin{cases} |x| & \text{ if }x\text{ is rational}\\ 0 & \text{ if }x\text{ is irrational} \end{cases}.$ Prove continuous

426 Views Asked by At

Given $f(x)=\begin{cases} |x| & \text{ if }x\text{ is rational}\\ 0 & \text{ if }x\text{ is irrational} \end{cases}. $

Prove that $f(x)$ is continuous at $0$

and

$f(x)$ is not continuous at any point $c\ne0$.

For any sequence $x_n$ converging to 0 we have that $f(x_n)=f(0)=|x|$ however there exists another sequence($y_n$) of irrational numbers such that $y_n$ converges to $0$ however $f(y_n)=0$ which does not converge to $|x|$ which isn't what I'm trying to show.

1

There are 1 best solutions below

0
On

For any $r>0$, then $|f(x)|=f(x)\leq|x|$ for all $x\in(-r,r)$, as $|x|\rightarrow 0$ as $x\rightarrow 0$, so by Squeeze Theorem, $f(x)\rightarrow 0$, but $f(0)=0$, so $f$ is continuous at $x=0$.