# Is a function whose derivative vanishes at rationals constant? [duplicate]

I'm trying to make a problem for my advanced calculus students. I was thinking, if we have a differentiable function $f:\mathbb{R}\to\mathbb{R}$ such that $f'(q)=0$ for all $q\in\mathbb{Q}$, can we say that $f$ is constant?

• I do think it is a constant function.
– user371838
Commented Dec 1, 2016 at 15:43
• Suppose not, then there is a neighbourhood of some x such that $\|f(y)\|>a$ for all y in the neighbourhood.
– Paul
Commented Dec 1, 2016 at 15:44
• Commented Dec 1, 2016 at 16:13
• (Original article here: link.springer.com/article/10.1007%2FBF01449201) Commented Dec 1, 2016 at 16:27
• Commented Dec 1, 2016 at 17:11

## 1 Answer

The function $f$ doesn't have to be constant!

A non-constant function $f$ with the required properties is given as Exercise 13.J in A. C. M. van Rooij, W. H. Schikhof, A Second Course on Real Functions, based on an example due to Y. Katznelson and Karl Stromberg, in Everywhere differentiable, nowhere monotone, functions, Amer. Math. Monthly 81 (1974), 349–354, jstor.

Here is a copy of the example:

Another example is has been constructed by Dimitrie Pompeiu in Sur les fonctions dérivées, Math. Ann. 63 (1907), no. 3, 326—332, doi: 10.1007/BF01449201, eudml, GDZ.

You can have a look here.

• The wikipedia article states that there are nonconstant differentiable functions whose derivate vanishes on a dense set - how can we guarantee that the rational numbers are contained in this set? Commented Dec 1, 2016 at 16:42
• @Dominik : I agree, this doesn't need to be the case. But the example given in A. C. M. van Rooij, W. H. Schikhof exactly satisfies the condition $f'(x) = 0$ for all rational $x$. Commented Dec 1, 2016 at 16:43
• Why give this complicated example when the the Pompeiu example, which is proved at the link you gave (thanks), is simpler and is a direct answer to the question of the OP?
– zhw.
Commented Dec 1, 2016 at 21:52
• No, the wiki. article deals specifically with the rationals in $[0,1].$ (And it doesn't matter; it can be any countable subset of $[0,1].$) Let $f$ be this function. Then $f'(0)=f'(1) =0.$ So we can extend this $f$ to $[0,2]$ as follows: For $x\in [1,2],$ let $f(x) = f(x-1) + f(1)-f(0).$ Now we have a differentiable $f$ strictly increasing on $[0,2]$ such that $f'(q)=0$ for each rational $q\in [0,2].$ We can continue this to the right or left to obtain a strictly increasing differentiable function on $\mathbb R$ whose derivative equals $0$ at each rational $q\in \mathbb R.$
– zhw.
Commented Dec 1, 2016 at 22:49
• @zhw: But the construction from the wikipedia article yields a function whose derivative vanishes in the points $g(p_i)$, where $p_i$ are the rationals in $[0, 1]$. It is not clear why the derivative should also vanish in the $p_i$. Commented Dec 2, 2016 at 13:08