# Does $f'(x)\in \mathbb Z$ a.e. implies that $f$ is an affine function?

Conjecture: Let $f: \mathbb R \to \mathbb R$ be an everywhere differentiable function and assume that $f'(x) \in \mathbb Z$ almost everywhere. Then is $f$ necessarily an affine function?

Can you give me a proof or a counter-example ? I thought of the devil's staircase, but this is not differentiable everywhere.

• Use Darboux's theorem for the derivative. teachingcalculus.com/2014/08/18/darbouxs-theorem to deduce that the derivative is constant. Apr 4, 2017 at 12:11
• Do you assume that $f$ is everywhere or almost everywhere differentiable? Apr 4, 2017 at 12:16
• @uniquesolution But the derivative is only assumed to be integral a.e., so the application of Darboux, if it works at all, isn't all that straightforward. Or did I miss something? Apr 4, 2017 at 14:16
• @Paul Why can't $f'$ attain all noninteger values in $[z_1,z_2]$ on a set of measure zero? Apr 5, 2017 at 1:46
• I found this which can answer my question mathoverflow.net/questions/266377/… Apr 5, 2017 at 7:16

Yes, $f'$ must be constant. This has been answered in the comments; the result in https://mathoverflow.net/questions/266377/how-quickly-can-the-derivative-of-an-everywhere-differentiable-function-change-s gives a kind of positive measure Darboux theorem. This is a special case of How irregular can $f'$ be beyond Darboux's Theorem?