# A differentiable function whose derivative is 0 almost everywhere, but not everywhere

In another thread, I remarked that if $$\int_0^1 \vert f'(x)\vert\mathrm dx=0,$$ then $$f'(x)=0$$ for all $$x\in(0,1)$$ can only be concluded if $$f'$$ is continuous. This would certainly be correct if we were talking about a general integrable function $$(0,1)\to\mathbb R$$. Take the characteristic function of a singleton set as a counterexample where the integral vanishes, but the function doesn't. But such a function is not a valid derivative of any function, since it doesn't have the mean value property. And I couldn't find any functions where the integral of the absolute value vanishes and which have the mean value property. That's why I'm wondering:

Is there a differentiable function $$f:(0,1)\to\mathbb R$$ such that $$f'$$ is not identically $$0$$, but $$\int_0^1\vert f'(x)\vert\mathrm dx=0,$$ or equivalently, $$f'$$ is $$0$$ almost everywhere, but not everywhere.

• Cantor Function has this property. – Surb Nov 14 '20 at 11:27
• I was looking up the Wikipedia link for the Cantor ternary function, but by the time I returned I found that @Surb had beat me to it. Well, for more than you'd probably want to know about this topic, see the references and discussions to the Stack Exchange "question" Bibliography for Singular Functions. – Dave L. Renfro Nov 14 '20 at 11:29
• @Surb: If I understood correcly, the OP is looking for a differentiable function, while the Cantor function is only a.e. differentiable – Caffeine Nov 14 '20 at 11:30
• And also (if I'm not mistaken), a function that is not absolutely continuous (otherwise $f(x)=\int_0^x\boldsymbol 1_{\mathbb Q}(t)\,\mathrm d t$ would obviously work. @Caffeine – Surb Nov 14 '20 at 11:35
• Maybe this: en.wikipedia.org/wiki/Pompeiu_derivative and this: math.stackexchange.com/questions/112067/… are relevant? Not really sure though – Adam Rubinson Nov 14 '20 at 11:35

If $$f$$ is differentiable at every point of $$(0,1)$$ and $$\int_0^{1} |f'| <\infty$$ then $$f$$ is absolutely continuous. This theorem is proved in Rudin's RCA. So if we also assume that $$f'=0$$ a.e. then $$f$$ is a constant and $$f'(x)=0$$ for every $$x$$.
• More precisely, if $f$ is everywhere differentiable and $f'=0$ a.e., then $f$ has a signed-infinite derivative at continuum many points (Theorem $1',$ p. 222 here) and $f'$ does not exist finitely or infinitely at continuum many points (corollary on p. 21 here). For even more, see On singular functions by K. M. Garg, pp. 1441-1452 in Revue Roumaine de Mathématiques Pures et Appliquées 14 #10 (1969)], and papers/books that cite Garg's paper (google "Garg" & paper title). – Dave L. Renfro Nov 14 '20 at 11:55