weak derivative and almost everywhere derivation

What are some conditions that ensure that a function $f(x) : \mathbb{R} \to \mathbb{R}$ which is in $L^1_{loc}$ and almost everywhere differentiable (in the classical sens ) with derivative in $L^1_{loc}$ has its derivative equal to its weak derivative (its derivative in the sens of distributions) ie :

$$\forall \phi \in C^{\infty}_c(\mathbb{R}) ; \int f'\phi = - \int f \phi'$$

For example this is false for the characteristic function $\xi_{[0;1]}$which weak derivative is the difference of two dirac measures while its classical derivative is almost everywhere 0.

It works on the other hand for $C^1$ functions.

Does it work for Lipschitz functions ? Are there some necessary conditions ?

Edit : It does work for lipshitz function thx to the dominated convergence theorem

The necessary and sufficient condition is that $f$ should be absolutely continuous. This is a version of the fundamental theorem of calculus, and can be found in most graduate-level real analysis books.
• If its weak derivative is $L^1_{loc}$, then yes. By letting your test function approach $1_{[a,b]}$, you get $f(b)-f(a) = \int_a^b f'$ for all $a,b$, and it follows by the above-mentioned FTC that $f$ is absolutely continuous and a.e. differentiable. Of course, any $L^1_{loc}$ function has a weak derivative as a distribution, and this says nothing about its pointwise differentiability. – Nate Eldredge Apr 24 '17 at 22:39
• Isn't the characteristic function of the rational numbers has $0$ as weak derivative, but even nowhere continuous? – David Lingard Aug 1 at 22:00
• @DavidLingard: Yes, of course. What I should have said is that if $f$ is a function whose weak derivative is $L^1_{\text{loc}}$ then $f$ is almost everywhere equal to a function which is absolutely continuous and a.e. differentiable, and whose classical derivative equals its weak derivative almost everywhere. – Nate Eldredge Aug 3 at 5:24