Prove that the following function is continuous at irrational numbers

continuityreal-analysis

$f(x)=1$,if $x\in (\mathbb{R-Q})\cup \{0\}$,
$$f(x)=1-\frac1p, \text{ if }x= \frac np,n\in \mathbb{Z}-\{0\}, p\in \mathbb{N}, \gcd(n,p)=1$$

I want to show that it is continuous at every irrational point. I was able to show that it is discontinuous at rational points through sequential criteria. But I am not able to show that it is continuous at irrational points. I think I may have to use the definition of continuity, i.e $\forall \epsilon>0, \exists \delta>0$ such that $|x-c|<\delta \implies |f(x)-f(c)|<\epsilon$. But I have no clue as to how to start for it. Any hints are appreciated!

So, this is what I've tried so far:

If b is an irrational number and $\epsilon>0$, then there is $p_0\in N$ such that $1/p_0<\epsilon$. There are only a finite number of rationals with denominator less than $p_0$ in the interval $(b-1/p_0,b+1/p_0)$. Hence $\delta$ can be chosen so small that the nbd $(b-\delta,b+\delta)$ contains no rationale with denominator less than p. Then for $|x-b|<\delta$, we have$ |f(x)-f(b)|=|f(x)-1| <|f(x)|<1/p_0<\epsilon$.

Is this correct?

Best Answer

Here's a proof that I accept is cheating at certain level, but it works for sure-

We know that the Thomae's function is discontinuous at rationals and continuous at irrationals. So, the negative of this function should also satisfy these same properties. So, $1$ added to the negative of this function should also satisfy these.

Since the given function is $f(x)=1-T(x)$ where $T(x)$ is the Thomae's function, $f(x)$ must be discontinuous at rationals and continuous at irrationals.