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$.

Let $g_n(x)=\frac{x}{n}\mathbb{1}_{[0,n]}(x)$. This is a sequence of non-negative functions bounded by $1$. Since $f$ is non-negative and in $L^1(\mathbb{R}^+)$, by the dominated convergence theorem
$$ \lim_{n\to +\infty}\int_{0}^{+\infty}g_n(x)\,f(x)\,dx = \int_{0}^{+\infty}\lim_{n\to +\infty}g_n(x)\,f(x)\,dx = \int_{0}^{+\infty}0\cdot f(x)\,dx = 0.$$
