Can the Thomae Function be transformed into a continuous function

calculuscontinuity

Consider $f(x)= \dfrac{1}{q}~|~ x=\dfrac {p}{q},\gcd(p,q)=1$.

Can $f$ be defined on the irrationals in such a way that $f$ becomes continuous on $\mathbb R$?

Attempt: Let $f(x) = g(x)~|~x $ irrational.

Let $a$ be an irrational number. Then, we know that there exists a neighborhood $N_\delta$ of size $\delta$ such that $(a-\delta, a+\delta)$ doesn't contain any rational number of the form $\frac{m}{n}$ such that $\frac{1}{n} \ge \epsilon.$

Then: if $x = \frac{p}{q} \in N_\delta$ is a rational number:

$|f(x)-f(a)| \le ~|f(\frac{p}{q})|+|f(a)| = \frac {1}{q}+|g(a)|~ \le \epsilon+|g(a|)~\forall~x \in N_\delta$

For $f$ to be continuous at the irrational $a, ~|g(a)|$ must be arbitrarily small $~\forall a \in \mathbb R-\mathbb Q \implies g(a)=0 ~\forall~ \mathbb R-\mathbb Q $

But, then $f$ becomes discontinuous at all rationals ( as the Thomas function is ).

So, there doesn't exist any such function which can transform $f$ into a continuous function.

Am I correct in my approach? Thanks a lot

Best Answer

If the Thomae function has a continuous extension on $\mathbb{R}$, then it should be continuous over $\mathbb{Q}$. However, Thomae's function is not continuous as a function on the set of rational numbers: for example, $f\left(\frac{1}{2}-\frac{1}{2^n}\right)=\frac{1}{2^n}$ and $f\left(\frac{1}{2}\right)=\frac{1}{2}$ for $n\ge 2$, so $\lim_{n\to\infty} f\left(\frac{1}{2}-\frac{1}{2^n}\right) \neq f\left(\frac{1}{2}\right)$.