Thomae’s Function – Continuity at Irrationals

real-analysis

It is well known that the Thomae's Function is continuous at irrationals and discontinuous at rationals. I used the following definition to prove discontinuity at rationals:

A function $f\colon \mathbb{R}\rightarrow \mathbb{R}$ is said to be continuous at $a\in\mathbb{R}$ if given any open subset $V$ containing $f(a)$, there exists an open subset $U$ containing $a$ such that $f(U)\subseteq V$.

Question: How can we prove the continuity of Thomae's function at irrationals by this definition?

Best Answer

For all $q>0$, there exists $\epsilon_q$ such that there's no point with denominator $\le q$ in $(x-\epsilon_q,x+\epsilon_q)$ (This is because, when for $1$, we may choose an interval that does not contain integer, and we may choose interval that does not contain half of integer,...,and we intersect all these intervals that does not contain rational with denominator less than $q$). Thus $\forall y\in (x-\epsilon_q,x+\epsilon_q)$, $y<\frac{1}{q}$. Since $q$ is arbitrary, we know that for all $V$ containing $0$, there's a $n$ such that $B_{1/n}(0)\subset V$, and we choose $U=(x-\epsilon_n,x+\epsilon_n)$.