# Obvious but unprovable: If $f'$ is the zero function on $\mathbb Q$, then $f$ is constant [duplicate]

Let $f:\mathbb Q\to\mathbb R$ be a uniformly continuous function and assume that $f'(x)=0$ for all $x\in\mathbb Q$. That $f$ is constant is obvious...and, as far as I can tell, unprovable. Please tell me that I'm wrong!

## marked as duplicate by Watson, Crostul, Demosthene, Namaste, GlitchJan 17 '17 at 14:32

• This is a great example of why the word "obvious" is dangerous in mathematics – Alex Mathers Jan 17 '17 at 7:34
• Strongly related: math.stackexchange.com/questions/2039063 – Watson Jan 17 '17 at 8:50
• Moreover, we should notice that since $f : \Bbb Q \to \Bbb R$ is uniformly continuous, it extends to a unique continuous $g : \Bbb R \to \Bbb R$. However, I don't know why $g$ should be differentiable if $f$ is assumed to have a "rational derivative" at any point, i.e. the limit $\dfrac{f(x+h)-f(x)}{h}$ exists for all rational $x$, when the rational number $h$ tends to $0$. – Watson Jan 17 '17 at 9:06
• There exist functions whose derivative vanishes on a dense $G_\delta$ set – Andres Mejia Feb 8 '17 at 8:06

Upd: $?'(q) = 0 | \forall q \in \mathbb{Q}$ can be proven by taking $q_n \to q^+$ such that ${?(q_n) - ?(q) \over q_n - q} \to 0$ and $r_n \to q^-, {?(r_n) - ?(q) \over r_n - q} \to 0$ (since the function is monotonic, for any other sequence $x_n \to q^+$, ${?(x_n) - ?(q) \over x_n - q}$ can be "sandwiched" between two similar subsequences based on $q_n$; since it's continuous, pointwise limit value equals derivative value).
Let $q = [q_0; q_1, ..., q_k]$, then take $q_n = [q_0; q_1, ..., q_k, n]$ and see that $?(q_n) = ?(q) + (-1)^k2^{-(a_1+a_2+...+a_k+n-1)}$; $q_n = {an+b \over cn+d}$ where $q = {a \over c}$, $a,b,c,d$ don't depend on $n$. Then ${?(q_n) - ?(q) \over q_n - q} = (-1)^k{c(cn+d) \over (bc-ad)2^{a_1+...+a_k+n-1}} \sim n2^{-n} \to 0$. Taking $r_n = [q_0; q_1, ..., q_k -1, 1, n]$ concludes the proof.
• Little question: why is Minkowski's question mark function uniformly continuous on $\Bbb R$? It is on every compact set, obviously, but on the whole real line I'm not sure. Thank you! – Watson Jan 17 '17 at 9:09
• @Watson One can just take it on $[0,1]$ and then extend to $[0,2]$ by $f(x) = f(2-x)$ and then on whole $\mathbb{R}$ by $f(x) = f(x+2)$. Then for any given $\varepsilon>0$ $\delta$ you get for $[0,1]$ is enough everywhere else. – Abstraction Jan 17 '17 at 9:13
• @Abstraction : you don't even have to extend it to the real line : Minkowski's question mark function is already defined on $\mathbb{R}$ and $1$-periodic. – charmd Jan 17 '17 at 9:28
• @Casper One interesting statement is that if $f$ is analytic complex function, then it's constant on whole $\mathbb{C}$, not just real line. But of course this assumption is too strong. I'm not sure if it's enough to require $f'$ being defined everywhere - I have a feeling there still would be a counterexample, but can't build it (Minkowski function derivative isn't defined everywhere, for example see link.springer.com/article/10.1007/s10958-012-0750-2 ). – Abstraction Jan 17 '17 at 15:47