I am interested in knowing under which conditions $\lim_{t\to \infty} \frac{1}{t}\int_0^t f(s)ds$ implies that $\lim_{t\to \infty} f(t)$ exist.
It is known that $\lim_{t\to \infty} \frac{1}{t}\int_0^t f(s)ds$ can exist, but $\lim_{t\to \infty} f(t) $ not. For instace $f(t) = \cos t$.
First, I wonder if it is enough that $f(t)$ is continuous and $\lim_{t\to \infty} \frac{1}{t}\int_0^t f(s)ds$ converges to the maximum value of the image. However, I found this counter-example:
Let us define $f(t)$ by cases
$f(t):= 1 -2(t-(10^{n-1}-1))$ if $t \in [10^{n-1}-1,10^{n-1}-\frac{1}{2}]$,
$f(t):= 2(t-(10^{n-1}-\frac{1}{2}))$ if $t \in [10^{n-1}-\frac{1}{2},10^{n-1}]$,
$f(t) := 1$ if $t \in [10^{n-1},10^n-1] $
Where $n = 1,2,3,\dots$. We can provide a smooth example using the same argument and bump function. However $f(t)$ is not analytic. Since the proof relies that $f(t)$ is constant function in open interval. I wonder if $f(t)$ being analytic is enough.
Is true the following statement? Let $f(t):[0,\infty] \to [-1,1]$ be an analytic function. If $\lim_{t\to \infty} \frac{1}{t}\int_0^t f(s)ds = 1$, then $\lim_{t\to \infty} f(t) = 1$.
No, the statement is not true even for analytic functions: What we want to have is a function with mean converging to $1$ for $t \to \infty$ but whose value does not converge to $1$ for $t \to \infty$. Intuitively, this can be done easily by taking a periodic function which maps into $[0,1]$ and then push its values towards $1$ for large $t$ but still retaining some points which come close to $0$.
So let's take a periodic function, e.g. $\cos$ and scale it so that it maps into $[0,1]$:
$$ \frac{\cos(t)+1}{2} $$
Now we want that the mean value of this function converges to $1$ for $t \to \infty$. This can be done by applying an exponent which goes to $0$ for $t \to \infty$:
$$ \left(\frac{\cos(t)+1}{2}\right)^{\frac{1}{t+1}} $$
As the exponent pushes all nonzero values towards 1, one can easily see that the mean of this function is $1$ for $t \to \infty$. On the other hand, the function vanishes for all $t \in (\mathbb{Z} + \frac{1}{2}) \pi$. Consequently, it satisfies all requirements except that it fails to be analytic at its zeros. However, this can be fixed by lifting the function a little bit away from $0$ in such a way that it still comes arbitrarily close to $0$ for large $t$.
$$ f(t) = \left(\frac{\cos(t) + 1 + \left(\frac{1}{t+1}\right)^{t+1}}{2 + \left(\frac{1}{t+1}\right)^{t+1}}\right)^{\frac{1}{t+1}} $$
Note that the term added in the denominator servers just as a rescaling factor so that the function does not attain values larger than $1$. One can check directly that $\lim_{n \to \infty} f((n+1/2)\pi) = 0$, which finishes the proof.
Concerning your initial question about conditions: The only condition that I can think of is if $\lim_{t\to \infty} f(t)$ exists, then $$ \lim_{t\to \infty} \frac{1}{t}\int_0^t f(s)ds = \lim_{t\to \infty} f(t), $$ but this is rather elementary and I guess not really what you are looking for.
Edit: As alejandro pointed out, the derivative of the counterexample above is unbounded. However, one can also construct a counterexample with a bounded derivative. Instead of making the portions where $cos$ attains $0$ smaller (which increases the derivative), one can make the portions where $cos$ attains $1$ larger. Concretely, we want a function $f$ which looks like
This can be constructed analytically by adding shifted versions of the error function. Then precomposing this function with $cos$ looks like
and this is exactly what we want. I will leave out the details at this point because I think it's clear what's going on. All in all our counterexample looks approximately like
$$ \frac{1}{2} \left(\cos\left( \sum_{n \in \mathbb{N}} (\text{erf}(t - n^2) + 1)\pi \right) + 1\right), $$
where I guess one has to adjust the shifts and maybe also add a correction term for the error functions inside the sum so that the mean really converges to $1$ for $t \to \infty$.