Does the improper integral exist? I need to find a continuous and bounded function $\mathrm{f}(x)$ such that the limit
$$ \lim_{T\to\infty}  \frac{1}{T}\, \int_0^T \mathrm{f}(x)~\mathrm{d}x$$ 
doesn't exist. 
I thought about $\mathrm{f}(x) = \sin x$ but I am not sure if the fact that we divide by $T$ may some how make it converge to zero.
What do you think ?
 A: $ \sin(x) $ won't do, but it's only a tad trickier.
$$ f(x) = \sin\left(\ln(x)\right) $$ should do the job (you can integrate it exactly by elementary techniques and then show it is $ \mathcal{O}(T) $).
Note that the function is bounded and continuous in $ (0,+\infty) $.
A: The idea here is simple, but the details laborious. Keep the function at $+1$ long enough so the average hits some positive value, then keep the function at 
$-1$ long enough so the average hits some negative value and repeat.
Let $t_n = 2^{n+2}-4$.
Let $f_n(t) = \begin{cases} t-t_n, & t \in [t_n,t_n+1] \\
1 , & t \in (t_n+1,t_{n+1}-1) \\
1-(t-(t_{n+1}-1)) , & t \in [t_{n+1}+1, t_n] \\
0, \text{otherwise}\end{cases}$.
Note that $f_n$ has support $(t_n,t_{n+1})$,
and $\int_0^{t_{n+1}} f_n = t_n+3$.
Let $\phi(t) = \sum_{k=0}^\infty (-1)^kf_k(t)$. Then 
\begin{eqnarray}
\int_0^{t_{n+1}} \phi_n &=&
\sum_{k=0}^n (-1)^k (t_k+3) \\
&=& \sum_{k=0}^n (-1)^k (2^{k+2}-1) \\
&=& \sum_{k=0}^n (-2)^{k+2}- \sum_{k=0}^n (-1)^k  \\
&=& {4 \over 3} (1-(-2)^{n+1})- {1 \over  2} (1 - (-1)^{n+1})
\end{eqnarray}
Then
\begin{eqnarray}
\sigma_n &=&  {1 \over t_{n+1} }\int_0^{t_{n+1}} \phi_n \\
&=& {4 \over 3} {  (1-(-2)^{n+1})- {1 \over  2} (1 - (-1)^{n+1}) \over 2^{n+3}-4} \\
&=& {1 \over 3}{  (1-(-2)^{n+1})- {1 \over  2} (1 - (-1)^{n+1}) \over 2^{n+1}-1} \\
&=& {1 \over 3} { {1 \over 2^{n+1} } - (-1)^{n+1} - {1 \over 2^{n+2} (1 - (-1)^{n+1} }\over 1 - {1 \over 2^{n+1} } }
\end{eqnarray}
We see that $\liminf_n \sigma_n = - {1 \over 3}$, $\limsup_n \sigma_n = {1 \over 3}$, hence the limit does not exist.
A: The integral has to diverge to infinity if this limit is to not exist, (of course any other limit will give zero overall). Given the type $``\dfrac{\infty}{\infty}"$ limit, if we apply L'Hopitals; $$\displaystyle\lim_{T\to \infty}\dfrac{1}{T}\displaystyle\int_{0}^{T}f(x)\ dx = \lim_{T\to \infty} f(T)$$
This makes it clear that the limit doesn't exist iff $f$ is not bounded, so there is no suitable function. 
A: What about $\mathrm{f}(x)=T$?
$$ \lim_{T\to\infty}  \frac{1}{T}\, \int_0^T \mathrm{f}(x)~\mathrm{d}x=\lim_{T\to\infty}  \frac{1}{T}\, \int_0^T T~\mathrm{d}x=\lim_{T\to\infty}  \frac{1}{T}\, T^2=\infty$$ 
