# 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?

## marked as duplicate by user186473, Martin Sleziak, R_D, user91500, Claude Leibovici calculus StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Dec 2 '16 at 7:27

• I do think it is a constant function. – Rohan Dec 1 '16 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 Dec 1 '16 at 15:44
• – Watson Dec 1 '16 at 16:13
• (Original article here: link.springer.com/article/10.1007%2FBF01449201) – Watson Dec 1 '16 at 16:27
• – felipeuni Dec 1 '16 at 17:11

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? – Dominik Dec 1 '16 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$. – Watson Dec 1 '16 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. Dec 1 '16 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. Dec 1 '16 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$. – Dominik Dec 2 '16 at 13:08