of [[Thomae's function]]. **Theorem** The function $f:(0,1) \to \mathbb{R}$ defined by $f(x) = \begin{cases} \frac{1}{q} & x=\frac{p}{q} \text{ in lowest form, } p\geq 0 \\ 0 & x \not\in \mathbb{Q}. \end{cases}$is at [[Continuous Real Function|continuous]] at every irrational and [[Discontinuous Function|discontinuous]] at every irrational. **Proof** Rational implies discontinuous: Take $c = \frac{p}{q} \in \mathbb{Q} \cap (0,1)$ with $\gcd(p,q)=1$. Then $f(c) = \frac{1}{q}$. Given $\delta>0$ there exists $x \not \in \mathbb{Q}$ such that $|x-c|<\delta$ since [[Between two Different Real Numbers exists an Irrational Number]]. But $f(x)=0$ so $|f(x)-f(c)|= \frac{1}{q} \geq \epsilon.$ Irrational implies continuous: Now take $c \not \in \mathbb{Q}$ and some $\epsilon>0$. If $x = \frac{p}{q} \in \mathbb{Q}$ then $|f(x)-f(c)|= \frac{1}{q}$ is $\geq\epsilon$ iff $q \leq 1/\epsilon$. By [[Archimedean Property of Real Numbers|AP]] $\exists q' \in \mathbb{N}$ such $q'\leq 1/\epsilon$. There are finitely many $x \in(0,1)$ such that $f(x) \geq \frac{1}{q'}$ so the set $A = \{ x \in (0,1) : |f(x) - f(c)| \geq \epsilon \}$ is finite. If $\epsilon>1/2$ then the set will be empty so there is an element so whatever our choice of $\delta$, $x \in (0,1)$ and $|x-c|<\delta \implies |f(x)-f(c)|<\epsilon$. Otherwise the set is non empty and so there is an element $x^{*} \in A$ that is closest but not equal to $c$. In this case choose $\delta= |x^{*}-c|$. Now if $|x-c|<\delta$ then either $x$ is irrational so $f(x)=f(c)$ or $x$ is rational with denominator $q>q'\geq1/\epsilon$ hence $1/q<\epsilon$.