I search a continuous function $f : [0,+\infty[ \to \mathbb{R}$ such as : $\lim \limits_{x\to +\infty} \frac{1}{x} \int \limits_{0}^{x} f(t)\mathrm{d}t=\pm \infty$ and ($\lim \limits_{x\to +\infty}f(x)=l\in \mathbb{R}$ or $f$ does not have limits).
First I know that it doesn't work with monotone functions. Then I start to try with $x\mapsto cos(x)^2$ but it didn't work.
Thanks in advance !
Let us look at the two cases:
If $f : [0,+\infty[ \to \mathbb{R}$ is a continuous function and $\lim \limits_{x\to +\infty}f(x)=l\in \mathbb{R}$, it is easy to prove that $f$ is bounded. So there are $M$ such that, for all $x\in [0,+\infty[\,$, $\vert f(x) \vert \leq M$. So, for all $x\in [0,+\infty[\,$, $$\left\vert\frac{1}{x} \int \limits_{0}^{x} f(t)\mathrm{d}t\right \vert\leq \frac{1}{x} \int \limits_{0}^{x} \vert f(t) \vert \mathrm{d}t \leq M$$ So we can NOT have $\lim \limits_{x\to +\infty} \frac{1}{x} \int \limits_{0}^{x} f(t)\mathrm{d}t=\pm \infty$.
Example 1: Define $f(x)=x(1+\sin(x))$
Example 2: [from David C. Ullrich comment] Define $f(x)=x\cos^2(x)$