$f:\Bbb{R}\to [0,1]$ is continuous at what points?

149 Views Asked by At

Let $$ f(x) = \begin{cases} 1 & \text{if } x=0\\ \frac{1}{q} & \text{if } x = \frac{p}{q} \ \text{with } \gcd(p,q) = 1\\ 0 & \text{if } x\in\Bbb{R}\setminus\Bbb{Q} \end{cases} $$ Find where $f$ is continuous.

So as the rationals are dense in the irrationals, and the irrationals are dense in the rationals, I believe that the function $f$ is nowhere continuous. Is this correct, and if so, how do you formally prove that (with $\varepsilon$-$\delta$ definition of continuity)?

Edit: @SpamIAm has pointed out that the function in fact is continuous at all irrationals. I would like to see a proof of that.

2

There are 2 best solutions below

0
On BEST ANSWER

If $x$ is irrational, suppose you are given $\varepsilon$, and choose a positive integer $q$ so large that $1/q<\varepsilon$. Let $\delta>0$ be smaller than the distance between $x$ and the nearest integer multiple of $1/q$. That will show that $f$ is continuous at $x$. (Of course, you actually have to prove that that $\delta$ is small enough. I'll let you work on that for now.)

0
On

Partial answer: Note that $f|_{\Bbb{R}\setminus\Bbb{Q}}$ is the constant function $f(x)=0 \; \forall x\in\Bbb{R}\setminus\Bbb{Q}$. Then, it's continuous: fixed $a\in\Bbb{R}\setminus\Bbb{Q}$ and given $\varepsilon >0$ there exist $\delta = \varepsilon > 0$ such that $$x\in B_{\delta}(a)\cap (\Bbb{R}\setminus\Bbb{Q}) \Rightarrow f(x)\in B_{\varepsilon}(0).$$