Suppose that $f(x) \to 0$. Then for any $\varepsilon>0$ there exists $A>0$ fixed such that $|f(x)|<\varepsilon$ for all $x>A$.
Therefore $\frac{1}{x}|\int_0^xf(t)dt| \le \frac{1}{x}\int_0^A|f(t)|dt + \frac{1}{x}\int_A^x|f(t)|dt \le \frac{A}{x}\sup_{t \in [0,A]}|f(t)|+\varepsilon\frac{x-A}{x}$ The first term can be made $<\varepsilon$ the second too.
If the limit is not zero you can write $\frac{1}{x}\int_0^x(f(t)-a)dt+\frac{1}{x}\int_0^x a dt$