Limit of an integral of a continuous real-valued function 
If $f:[0,{\infty})\to\mathbb R$ continuous and $\lim_{x\to\infty}  f(x)=a$.
  Show that:
  $$
\lim_{x\to\infty} \frac1x\int_{0}^{x} f(t)\ \mathsf dt = a.
$$

If:
$$
\lim_{x\to\infty} \frac1x \int_{0}^{x}\ f(t)=
 \lim_{x\to\infty} \frac{1}{x} (F(x)-F(0))\ \mathsf dt$$
and $F(0)$ is some constant, all I need to show is $F(x)= xa$. 
This is where I am not sure how I should continue, if I what I did is correct, how should I continue?
 A: Let $\varepsilon > 0$. Since $\lim\limits_{x\to \infty} f(x) = a$, there exists $M > 0$ such that $|f(x) - a| < \varepsilon$ for all $x \ge M$. So for $x > M$,
$$\left|\frac{1}{x}\int_0^x f(t)\, dt - a\right| \le \frac{1}{x}\int_0^M |f(t) - a|\, dt + \frac{1}{x}\int_M^x |f(t) - a|\, dt < \frac{C}{x} + \frac{\epsilon(x - M)}{x},$$
where $C = \int_0^M |f(t) - a|\, dt$. Hence
$$\limsup_{x\to \infty}\left|\frac{1}{x}\int_0^x f(t)\, dt - a\right| \le \varepsilon.$$
Since $\varepsilon$ was arbitrary, the result follows.
A: METHOD 1:
L'Hospital's Rule comes to the rescue.
$$\begin{align}
\lim_{x\to \infty}\frac{\int_0^x f(t)\,dt}{x}&=\lim_{x\to \infty}\frac{d}{dx}\int_0^x f(t)\,dt\\\\
&=\lim_{x\to \infty}f(x)=a
\end{align}$$

METHOD 2:
If one does not wish to appeal to L'Hospital's Rule, then another approach is to take a similar way forward to that of the OP.  Here,  we don't show that $F(x)=xa$.  
Rather, we recognize that for any $\epsilon >0$, there is a number $L$ such that for $x>L$, $a-\epsilon<f(x)<a+\epsilon$.  Then, we can write for such a fixed $L$
$$\left|\frac1x\int_0^xf(t)\,dt-a\right|\le\frac1x\int_0^L|f(t)-a|\,dt+\frac1x\int_L^x|f(t)-a|\,dt \tag 1$$
The first integral on the right-hand side of $(1)$ goes to zero as $x\to \infty$ while the second integral is less than $\epsilon$.  And the proof is complete.
