TITLE: A sufficient condition for a function to be of class $C^2$ in the weak sense.
QUESTION [5 upvotes]: Let $f\colon\mathbb{R}\to\mathbb{R}$ be a continuous function with weak derivative (i.e. the derivative in the sense of distribution) in $C^1(\mathbb{R})$. Does this condition imply that $f$ is two times continuously differentiable (i.e. $f\in C^2(\mathbb{R}))$?

REPLY [3 votes]: The answer is yes.
Lemma Assume that $u \in \mathscr{D}'(X)$, where $X$ is an open interval in $\mathbb{R}$ and that $u' = 0$ (in the sense of distributions). Then $u$ is (can be identified with) a constant.
This result should be in most textbooks on distribution theory. I'll give a sketch of the proof for $X = \mathbb{R}$.
Step 1: Show that $\phi \in C^\infty_c$ is a derivative of a test function if and only if $$\int_{-\infty}^{\infty} \phi\,dx = 0.$$
Step 2: Choose a fixed $\psi \in C^\infty_c$ with $\int \psi = 1$, and let $C = \langle u, \psi\rangle$.
Step 3: Take an arbitrary $\phi \in C^\infty_c$ and choose $c$ so that $\phi - c\psi$ has integral $0$, i.e. $c = \int \phi$. Then $\phi-c\psi = \chi'$ for some $\chi \in C^\infty_c$.
Put everything together:
$$ 0 = \langle u', \chi \rangle = - \langle u, \chi' \rangle = 
-\langle u, \phi \rangle + c\langle u, \psi\rangle
= -\langle u, \phi \rangle + C\int \phi = 
-\langle u, \phi \rangle + \langle C, \phi\rangle.
$$
for all $\phi \in C^\infty_c$. This shows that $u$ is in fact a constant $C$.
Returning to the original question. Let $g \in C^1$ be the distributional derivative of $f$ and define
$$ G(x) = \int_0^x g(t)\,dt $$
Then $G \in C^2$, and it's clear that $G' = g$ (both in classical sense, and in distributional sense). Hence $G' = g = f'$ (in the sense of distributions), so by the lemma, $f = G + C$. In other words, $f$ can be identified with a $C^2$ function.