==Properties==
{{unordered list
*Thomae's function <math>f</math> is [[Bounded function|'''bounded''']] and maps all real numbers to the [[unit interval]]:<math>\;f: \mathbb R\; \to \;[0,\; 1].</math>
*|Thomae's function <math>f</math> is [[periodicBounded function|'''periodicbounded''']] withand periodmaps <math>1:\;all f(xreal +numbers n)to = f(x)</math> for allthe [[integerunit interval]]s:<math>\;f: {{mvar|n}}\mathbb andR\; all\to real\;[0,\; {{mvar|x}}1].</math>
|<math>f</math> is [[periodic function|'''periodic''']] with period <math>1:\; f(x + n) = f(x)</math> for all [[integer]]s {{mvar|n}} and all real {{mvar|x}}.
{{Collapse top|title=Proof of periodicity|width=80%}}
{{Collapse bottom}}
*|<math>f</math> is [[Continuous function|'''discontinuous''']] at all rational numbers, [[Dense order|dense]] within the real numbers.
{{Collapse top|title=Proof of discontinuity at rational numbers|width=80%}}
This establishes <math>f(x_0) = 1/q.</math>
Let <math>\;\alpha \in \mathbb R \smallsetminussetminus \mathbb Q\;</math> be any [[irrational number]] and define <math>x_n = x_0 + \frac{\alpha}{n}</math> for all <math>n \in \mathbb N.</math>
These <math>x_n</math> are all irrational, and so <math>f(x_n) = 0</math> for all <math>n \in \mathbb N.</math>
{{Collapse bottom}}
*|<math>f</math> is '''continuous''' at all [[irrational number]]s, also dense within the real numbers.
{{Collapse top|title=Proof of continuity at irrational arguments|width=80%}}
Since <math>f</math> is periodic with period <math>1</math> and <math>0 \in \Q,</math> it suffices to check all irrational points in <math>I=(0,\;1).\;</math> Assume now <math>\varepsilon > 0,\; i \in \N</math> and <math>x_0 \in I \smallsetminussetminus \Q.</math> According to the [[Archimedean property]] of the reals, there exists <math>r \in \N</math> with <math>1/r < \varepsilon ,</math> and there exist <math>\; k_i \in \N,</math> such that
for <math>i = 1, \ldots, r</math> we have <math>0 < \frac{k_i}{i} < x_0 < \frac{k_i +1}{i}.</math>
:<math> |x - x_0| < \delta \implies |f(x_0) - f(x)| = f(x) < \varepsilon.</math>
Therefore, <math>f</math> is continuous on <math> \mathbb R \smallsetminussetminus \mathbb Q.\quad</math>
{{Collapse bottom}}
*|<math>f</math> is '''nowhere differentiable'''.
{{Collapse top|title=Proof of being nowhere differentiable|width=80%}}
:* For rational numbers, this follows from non-continuity.
:* For irrational numbers: ▼
*:For any [[sequence]] of irrational numbers <math>(a_n)_{n=1}^\infty</math> with <math>a_n \ne x_0</math> for all <math>n \in \mathbb{N}_{+}</math> that converges to the irrational point <math>x_0,\;</math> the sequence <math>(f(a_n))_{n=1}^\infty</math> is identically <math>0,\;</math> and so <math>\lim_{n \to \infty}\left|\frac{f(a_n)-f(x_0)}{a_n - x_0}\right| = 0.</math>
▲:* For irrational numbers:
*::ForAccording anyto [[sequenceHurwitz's theorem (number theory)|Hurwitz's theorem]], there also exists a sequence of irrationalrational numbers <math>(a_nb_n)_{n=1}^{\infty</math>} with= <math>a_n \ne x_0<(k_n/math> for all <math>n \in \mathbb{N})_{+n=1}^\infty,\;</math> that convergesconverging to the irrational point <math>x_0,\; </math> the sequencewith <math>(f(a_n))_{n=1}^k_n \inftyin \mathbb Z</math> is identicallyand <math>0,n \;in \mathbb N</math> coprime and so <math>\lim_{|k_n/n \to- \infty}\left x_0| < \frac{f(a_n)-f(x_0)1}{a_n - x_0\sqrt{5}\right|cdot = 0n^2}.\;</math>
:*:Thus for all <math>n,</math> <math>\left|\frac{f(b_n)-f(x_0)}{b_n - x_0} \right| > \frac{1/n - 0}{1/(\sqrt{5}\cdot n^2)} =\sqrt{5}\cdot n \ne 0\;</math> and so {{nowrap|<math>f</math> is not differentiable}} at all irrational <math>x_0.</math> ▼
::According to [[Hurwitz's theorem (number theory)|Hurwitz's theorem]], there also exists a sequence of rational numbers <math>(b_n)_{n=1}^{\infty} = (k_n/n)_{n=1}^\infty,\;</math> converging to <math>x_0,\; </math> with <math>k_n \in \mathbb Z</math> and <math>n \in \mathbb N</math> coprime and <math>|k_n/n - x_0| < \frac{1}{\sqrt{5}\cdot n^2}.\;</math>
▲::Thus for all <math>n,</math> <math>\left|\frac{f(b_n)-f(x_0)}{b_n - x_0} \right| > \frac{1/n - 0}{1/(\sqrt{5}\cdot n^2)} =\sqrt{5}\cdot n \ne 0\;</math> and so {{nowrap|<math>f</math> is not differentiable}} at all irrational <math>x_0.</math>
{{Collapse bottom}}
*|<math>f</math> has a strict '''[[maxima and minima|local maximum]]''' at each rational number.{{citation needed|date=September 2017}}
::See the proofs for continuity and discontinuity above for the construction of appropriate [[neighborhood (mathematics)|neighbourhoods]], {{nowrap|where <math>f</math> has}} maxima.
*|<math>f</math> is '''[[Riemann integrable]]''' on any interval and the integral evaluates to <math>0</math> over any set.
::The [[Lebesgue integrability condition|Lebesgue criterion for integrability]] states that a bounded function is Riemann integrable if and only if the set of all discontinuities has [[Lebesgue measure|measure zero]].<ref>{{Harvnb|Spivak|1965|p=53|loc=Theorem 3-8}}</ref> Every [[countability|countable]] subset of the real numbers - such as the rational numbers - has measure zero, so the above discussion shows that Thomae's function is Riemann integrable on any interval. The function's integral is equal to <math>0</math> over any set because the function is equal to zero ''[[almost everywhere]]''.
*|If <math>G = \{ \, (x,f(x)) : x \in (0,1) \, \} \subset \mathbb{R}^2</math> is the graph of the restriction of <math>f</math> to <math>(0,1)</math>, then the [[Minkowski–Bouligand dimension|'''box-counting dimension''']] of <math>G</math> is <math>4/3</math>.<ref>{{cite journal |last1=Chen |first1=Haipeng |last2=Fraser |first2=Jonathan M. |last3=Yu |first3=Han |year=2022 |title=Dimensions of the popcorn graph |journal=[[Proceedings of the American Mathematical Society]] |volume=150 |number=11 |pages=4729–4742 |doi=10.1090/proc/15729 |arxiv=2007.08407}}</ref>
}}
==Related probability distributions==
|