Non-differentiability in $\mathbb R\setminus\mathbb Q$ of the modification of the Thomae's function

Solution 1:

First I’ll prove a slightly weakened form of Dirichlet’s approximation theorem.

Theorem. For any real number $\alpha$ and positive integer $m$ there are integers $p_m$ and $q_m$ with $1\le q_m\le m$ such that $$|q_m\alpha-p_m|<\frac1m\;.$$

Proof. This is clearly true if $\alpha$ is rational, so assume that $\alpha$ is irrational. For $x\in\Bbb R$ let $\{x\}=x-\lfloor x\rfloor$, the fractional part of $x$. By the pigeonhole principle there must be distinct $i,j\in\{1,\dots,m+1\}$ and $k\in\{0,\dots,m-1\}$ such that $$\frac{k}m\le\{i\alpha\},\{j\alpha\}<\frac{k+1}m\;,$$ so that $0<\{|i-j|\alpha\}<\frac1m$, and $1\le|i-j|\le m$. Let $q_m=|i-j|$, and let $p_m=\lfloor q_m\alpha\rfloor$; then $$0<\{q_m\alpha\}=q_m\alpha-p_m<\frac1m\;.\dashv$$

It follows that if $\alpha$ is irrational, the sequence $\left\langle\frac{p_m}{q_m}:m\in\Bbb Z^+\right\rangle$ converges to $\alpha$. Moreover, for each $m\in\Bbb Z^+$ we have $$\left|\alpha-\frac{p_m}{q_m}\right|<\frac1{mq_m}\le\frac1{q_m^2}$$ and hence

$$\frac{\left|f\left(\frac{p_m}{q_m}\right)-f(\alpha)\right|}{\left|\frac{p_m}{q_m}-\alpha\right|}=\frac{f\left(\frac{p_m}{q_m}\right)}{\left|\frac{p_m}{q_m}-\alpha\right|}>q_m^2f\left(\frac{p_m}{q_m}\right)\ge 1\;.$$

Thus, if $f\,'(\alpha)$ exists, it must satisfy $|f\,'(\alpha)|\ge 1$. On the other hand, a similar calculation using a sequence of irrational numbers converging to $\alpha$ shows that $f\,'(\alpha)$, if it exists, must be $0$. It follows that $f$ is not differentiable at $\alpha\in\Bbb R\setminus\Bbb Q$.