$\lim_{x\to\infty}\frac{1}{x^2}\int_0^x\!yf(y)\,\mathrm{d}y=\frac{a}{2}$ if $\lim_{x\to\infty}f(x)=a$ 
Suppose $f(x)$ is a continuous real-valued function on $[0,\infty)$
  such that $\lim_{x\to\infty}f(x)=a$ for some $a\in\mathbf{R}$. Show
  that $$
\lim_{x\to\infty}\frac{1}{x^2}\int_0^x\!yf(y)\,\mathrm{d}y=\frac{a}{2}
$$ where the integral is taken with respect to the Lebesgue measure.

This is from an old real analysis prelim. I have no idea where to start or what results might be applicable here.
 A: Let $\epsilon > 0$. Since $\lim\limits_{x\to \infty} f(x) = a$, there exists a positive number $M$ such that $|f(x) - a| < \epsilon$ for all $x \ge M$. Now since $$\frac{1}{x^2}\int_0^x yf(y)\, dy - \frac{a}{2} = \frac{1}{x^2}\int_0^x yf(y)\, dy - \frac{1}{x^2}\int_0^x ya\, dy = \frac{1}{x^2}\int_0^x y(f(y) - a)\, dy,$$
then
\begin{align}\left|\frac{1}{x^2}\int_0^x yf(y)\, dy - \frac{a}{2}\right| &\le \frac{1}{x^2}\int_0^M |y(f(y) - a)|\, dy + \frac{1}{x^2} \int_M^x |y(f(y) - a)|\, dy \\
&< \frac{C(M)}{x^2} + \epsilon\frac{(x - M)^2}{2x^2},
\end{align}
where $C(M)$ is the constant $\int_0^M |y(f(y) - a|\, dy$. Taking the superior limit as $x\to \infty$ yields
$$\limsup_{x\to \infty} \left|\frac{1}{x^2}\int_0^x yf(y)\, dy - \frac{a}{2}\right| \le \frac{\epsilon}{2}.$$
Since $\epsilon$ was arbitrary, the result follows.
A: Since we have continuity, why not use L'Hopital? We are looking at 
$$\frac{\int_0^xyf(y)\,dy}{x^2}.$$
The denominator $\to \infty,$ and both numerator and denominator are differentiable (the numerator by FTC), so we are entitled to look at 
$$\frac{xf(x)}{2x} = \frac{f(x)}{2} \to \frac{a}{2}.$$
Thus $a/2$ is the desired limit.
