I want to see the statement below.
For $f\in\mathcal L^1(\mathbb R)$,$a\in\mathbb R,t>0$, $$\frac{1}{2t}\int_{a-t}^{a+t}|f(x)-f(a)|dx\leqq\sup_{|x-a|\leqq t}|f(x)-f(a)|.$$
My book says that this is shown easily by this proposition:
For measure space $(X,\mathcal S,\mu)$, $A\in\mathcal S$, $f:X\to[-\infty,\infty]$, if $\int_A fd\mu$ is defined, then $$\left|\int_A fd\mu\right|\leqq\mu(A)\sup_{x\in A}|f(x)|.$$
From this proposition, I have \begin{align} \left|\int_{a-t}^{a+t}f(x)-f(a) dx\right| &=\left|\int_{[a-t,a+t]}f(x)-f(a) dx\right|\\ &\leqq m([a-t,a+t])\sup_{x\in[a-t,a+t]}|f(x)-f(a)|\\ &=2t\sup_{|x-a|\leqq t}|f(x)-f(a)| \end{align} ,where $m$ is Lebesgue measure.
And I get $\frac{1}{2t}\left|\int_{a-t}^{a+t}f(x)-f(a) dx\right|\leqq\sup_{|x-a|\leqq t}|f(x)-f(a)|.$
But this is a bit different from what I want to show:$\frac{1}{2t}\int_{a-t}^{a+t}|f(x)-f(a)|dx\leqq\sup_{|x-a|\leqq t}|f(x)-f(a)|.$
How can I derive this inequality ? Thanks for the help.
Use the triangle inequality first and apply the proposition with $|f(x)-f(a)|$ instead of $f(x)-f(a)$.