Prove that $\lim_{n\to\infty}\frac1{n}\int_0^{n}xf(x)dx=0$. Let $f$ be a continuous, nonnegative, real-valued function and $$\int_0^{\infty}f(x)dx<\infty.$$ Prove that $$\lim_{n\to\infty}\frac1{n}\int_0^{n}xf(x)dx=0.$$
A start: If $\lim\limits_{n\to\infty}\int_0^{n}xf(x)dx$ is finite, then it's obvious. Otherwise, perform L'Hopital's rule, we get $\lim nf(n)$, which we want to show is $0$.

$$\forall n\geqslant k,\qquad0\leqslant\frac1{n}\int_0^{n}xf(x)\mathrm dx\leqslant\frac1n\int_0^{k}xf(x)\mathrm dx+\int_k^{\infty}f(x)\mathrm dx$$
