If $g$ is a Lebesgue integrable function in $E=\lbrack 0,\infty)$, prove that $$\lim_{n \rightarrow \infty}\frac{1}{n}\int_0^n xg(x)\,dx=0.$$
I want to use the absolute continuity of the Lebesgue integral, i.e, if $\epsilon >0$ there is $\delta > 0$ such as if $|E|<\delta$ (Lebesgue measure) then $\int_E g(x)\,dx<\epsilon.$ I would like to split the integral in the subsets $\lbrack 0 , n-\delta\rbrack$ and $\lbrack n-\delta, n)$ (the last one has measure $\delta$) but I think this is wrong. Thank you very much for your help!
Define for an integrable function $f$, $L_n(f):=1/n\int_0^n xf(x)\,\mathrm dx$. Then $|L_n(f)|\leqslant \lVert f\rVert_1$. Consequently, by an approximation argument, we can consider the case where $g$ is a linear combination of characteristic function of sets of finite measure. By linearity, it suffices to deal with the case $g=\chi_A$, where $A$ is a set of finite measure. Notice that for any $n$ and any $R\gt 0$, $$|L_n(\chi_A)|\leqslant \frac 1n\int_0^Rx\chi_A(x)\,\mathrm dx+\frac 1n\int_R^nx\chi_A(x)\,\mathrm dx\leqslant \frac Rn \lambda(A) + \lambda(A\cap (R,+\infty)),$$ hence $$\limsup_{n\to+\infty}|L_n(\chi_A)|\leqslant \lambda(A\cap (R,+\infty)).$$Since $A$ has a finite measure, we conclude letting $R\to +\infty$.