Function with a piecewise null derivative Given a continuous function $f : [a,b] \rightarrow \mathbb R$, if $Df(x) = 0$ for each $x \in [a,b] - E$, with E countably infinite, is it true that $f$ is constant? If $E$ is finite, then it is true, but the extension to a countably infinite set doesn't seem obvious to me.
 A: This is true but hard to prove. The following very general result is true:
Let $f$ be differentiable at each point of a measurable set $E$ in $\mathbb R$. Then $m^{*}(f(E)) \leq \int_E |f'(x)|\, dx$ [ $m$ is Lebesgue measure].
[Reference: Measure Theory by Bogachev, Vol I, Proposition 5.5.4, page 348].
Suppose $f$ is continuous and $f'(x)=0$ whenever $x \in E$ where $E^{c}$ is at most countable. Then we get $m(f(E))=0$. Since $m(f(E^{c}))=0$ we see that the range of $f$ (which is a  compact interval ) must have measure $0$. This means $f$ is a constant. 
A: This bugged me - I should be able to do this. Then Kavi says it's true but hard... It's not that hard.
The only not entirely elementary thing we need is Wiener's Covering Lemma; see for example the "finite version" here. (That "finite version"  really is Wiener, not Vitali; it's much simpler than the actual Vitali covering lemma...)
Suppose that $f:[a,b]\to\Bbb R$ is continuous, $E=\{x_1,x_2,\dots\}\subset [a,b]$ and $f'(x)=0$ for every $x\in[a,b]\setminus E$.
Let $\epsilon>0$.
Since $f$ is continuous at $x_j$ there is an open interval $V_j$ with $x_j\in V_j$ and $$m(f(V_j))<\epsilon 2^{-j}.$$So if $V=\bigcup V_j$ then $$m(f(V))<\epsilon.$$
Let $K=[a,b]\setminus V$. If $x\in K$ then $f'(x)=0$, so there is a relatively open interval $J_x\subset[a,b]$ with $x\in J_x$ and $$m(f(J_x))<\epsilon m(J_x).$$Since $K$ is compact it is covered by finitely many $J_x$. Now Wiener's covering lemma shows that there exist $x_1,\dots,x_n\in K$ such that if $I_j=J_{x_j}$ then $$K\subset\bigcup_1^nI_j$$and also $$I_1',\dots I_n'\,\,\,\text{are disjoint},$$if $I_j'$ is  the middle third of $I_j$. So $$m(f(K))\le\sum_1^nm(f(I_j))\le\epsilon\sum_1^n m(I_j)\le 3\epsilon\sum_1^nm(I_j')=3\epsilon m\left(\bigcup_1^nI_j'\right)\le3[b-a]\epsilon.$$So $$m(f([a,b]))\le(1+3[b-a])\epsilon.$$Hence $m(f([a,b]))=0$, so $f([a,b])$ must be a single point (since it's an interval).
If you're looking for an exercise, try to prove the "very general result" that Kavi cited, arguing sort of as above.
