Let $f:\mathbb{R}\to \mathbb{R}$ be a function of bounded variation. Define $\overline{f}(x)$ by $$\overline{f}(x) = \limsup_{\mu(I)\to 0} \frac{1}{\mu(I)} \int_I f(x) dx,$$ where $I$ ranges over intervals containing $x$. It is known that the total variation $|\overline{f}|_{TV}$ of $\overline{f}$ is minimal among those of all functions equal to $f$ almost everywhere; see, e.g., Lemma 3.3 in https://arxiv.org/pdf/math/0601044.pdf.
Now, that should be a very classical result. Does anybody have an older or standard reference?