1

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.

Teoc
  • 8,867
  • 1
    Actually, it turns out that $f$ is continuous at all irrationals. See here. ($f$ is called Thomae's function.) – Viktor Vaughn Oct 30 '16 at 02:43
  • Rationals are not dense in the irrationals or the opposite. Rationals are dense in the reals, and the irrationals are dense in the reals. The function of your question is named the Tomae function, you can see a lot of proofs here in mathexchange about what you want. –  Oct 30 '16 at 03:30

2 Answers2

1

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).$$

Rodrigo Dias
  • 4,445
1

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.)