Recall that the pointwise variation of a function $f:(a,b)\rightarrow\mathbb{R}$ is defined as the quantity $$V_a^bf=\sup_P\sum_{i=1}^n|f(t_i)-f(t_{i-1})|$$ where $P$ is the collection of all partitions $a<t_0<t_1<\dots<t_n<b$. Let us write for convenience $f\in bv(a,b)$ if $V_a^bf<\infty$.
Similarly the essential variation of $f$ is defined in Giusti's book (Minimal Surfaces and Functions of Bounded Variation) as $$\text{ess}V_a^bf=\sup_{P'}\sum_{i=1}^n|f(t_i)-f(t_{i-1})|$$ where $P'\subset P$ is the collection of all partitions $a<t_0<t_1<\dots<t_n<b$ such that each of the $t_i$ is a point of approximate continuity of $f$ (other sources require the $t_i$ to be Lebesgue points of $f$).
It is then claimed that if $f\in L^1(a,b)$ then $$\text{ess}V_a^bf=\inf\{V_a^bg:g\in bv(a,b), g=f\text{ almost everywhere on }(a,b)\}$$
It is easy to see that whenever $f\in bv(a,b)$, $\text{ess}V_a^bf\leq V_a^b f$ since the $\sup$ on the LHS is over al smaller collection of partitions. I also see why $$f=g \text{ almost everywhere }\Rightarrow \text{ess}V_a^bf=\text{ess}V_a^bg$$ and these two facts imply that $\text{ess}V_a^bf=\inf\{V_a^bg:g\in bv(a,b), g=f\text{ almost everywhere on }(a,b)\}$.
I haven't been able to prove the other inequality though. I don't understand how approximate continuity helps, besides the fact that almost every point is a point of approximate continuity. Can anyone give me an idea of how the proof of the other inequality goes?