Consider $ f $ a lebesgue function integrable in any limited range of $ [0, + \infty]$ ...show that... Consider $ f $ a lebesgue function integrable in any limited interval of $ [0,\infty)$ and such that the limit in $ x \to \infty $ is $ c $, show that
$$\lim_{a\to\infty}\frac{1}{a}\int_{0}^{a}f(x) dx = c$$ $$
hypotheses:
$(i)$ $ f $ is lebesgue function integrable in any limited interval of $ [0, + \ \infty)$
$(ii)$ $\lim_{a\to\infty}f(x) = c$
I thought:
$ |\frac{1}{a}\int_{0}^{a}f(x) dx - c | = |\int_{0}^{a}\frac{1}{a}f dx - \int_{0}^{a} \frac{c}{a} | = |\int_{0}^{a} \frac{1}{a}(f-c) |\leq   \int_{0}^{a} \frac{1}{a}|f-c|$ 
Since $ | f-c | $ I can control using the $ f $ limit so I figured I could use this to solve, but I can not continue
 A: Since for any $\epsilon > 0$, there exists $K$ such that $|f(x) - c| < \epsilon$ for all $x \geqslant K$, it follows that
$$\begin{align}\left|\frac{1}{a}\int_0^a f(x) \, dx - c \right| &\leqslant \frac{1}{a}\int_0^a|f(x) - c| \, dx \\ &=\frac{1}{a}\int_0^K|f(x) - c| \, dx+ \frac{1}{a}\int_K^a|f(x) - c| \, dx \\ &\leqslant \frac{1}{a}\int_0^K|f(x) - c| \, dx+ \frac{a-K}{a}\epsilon\end{align}$$
Since, the RHS tends to $\epsilon$ as $a \to \infty$, we have for any $\epsilon > 0$,
$$0 \leqslant \liminf_{a \to \infty}\left|\frac{1}{a}\int_0^a f(x) \, dx - c \right| \leqslant \limsup_{a \to \infty}\left|\frac{1}{a}\int_0^a f(x) \, dx - c \right| \leqslant \epsilon$$
Since $\epsilon$ can be arbitrarily close to $0$, this implies 
$$\begin{align}\lim_{a \to \infty}\left|\frac{1}{a}\int_0^a f(x) \, dx - c \right|  &= \liminf_{a \to \infty}\left|\frac{1}{a}\int_0^a f(x) \, dx - c \right| \\ &= \limsup_{a \to \infty}\left|\frac{1}{a}\int_0^a f(x) \, dx - c \right| \\ &= 0 \end{align}$$
Hence,
$$\lim_{a \to \infty}\frac{1}{a}\int_0^a f(x) \, dx = c$$
