Prove piecewise function is only continuous at $x=0$

384 Views Asked by At

A function $f(x)$ is defined:

$$f(x)=\cases{x,& $x \in \mathbb{Q} $\cr 0, &$~x \notin \mathbb{Q}$}$$

where $\mathbb{Q}$ denotes the set of rational numbers.

Prove that $f(x)$ is only continuous at $x=0$.

1

There are 1 best solutions below

0
On

HINT:

It follows from the density of $\Bbb Q$ in $\Bbb R$ namely:

Every open interval of real numbers contains rational numbers.

Continuity at $x=0$ is clear:

Given $\epsilon>0$ take $\delta=\epsilon$ and you'll have that $$ |f(y)-f(x)|=|f(y)|<\epsilon $$ whenever $|y|<\delta$ because $f(y)$ is either $0$ or $y$.

If $x\neq0$ you use the density of $\Bbb Q$ to show that you can find arbitrarily close $y$ near $x$ such that $|f(y)-f(x)|$ is larger than a suitably chosen $\epsilon$.

To work this out carefully, you have to distinguish between the two cases $x\in\Bbb Q$ and $x\notin\Bbb Q$.