Let us look at the two cases:
- Let us prove there is no 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}$
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$.
- On the other hand, it is rather easy to present examples of continuous functions $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 $f$ does not have limits.
Example 1: Define $f(x)=x(1+\sin(x))$
Example 2: [from David C. Ullrich comment] Define $f(x)=x\cos^2(x)$