Assume that f is a non-negative real function, and let $a>0$ be a real number.
Define $I_a(f)$ to be
$I_a(f)$=$\frac{1}{a}\int_{0}^{a} f(x) dx$
We now assume that $\lim_{x\rightarrow \infty} f(x)=A$ exists.
Now I want to proof whether $\lim_{a\rightarrow \infty} I_a(f)=A$ is true or not. I have concluded that this is not always true.
My approach has been to construct the following counterexample $f(x)=A+\frac {1}{x}$, it is easily seen that $\lim_{x\rightarrow \infty} f(x)=A$.
By integrating the chosen function I get that
$\lim_{a\rightarrow \infty}I_a(f)=A+\lim_{a\rightarrow \infty}\frac{1}{a}\int_{0}^a \frac{1}{x}dx = A+\lim_{a\rightarrow \infty} [\frac{\log(a)}{a}-(-\infty)]\rightarrow \infty$.
Therefore I concluded that $\lim_{x\rightarrow \infty} f(x)=A$ does not in general imply that $\lim_{a\rightarrow \infty}I_a(f)=A$.
I am of course unsure whether my calculations are correct, because you could also write the $\log(0)$ as a limit of $\log(\epsilon)\rightarrow \log(0)$, an then by division by $a$, and letting $a\rightarrow \infty$ get that the whole expression with the integral of $\frac{1}{x}$ goes to zero, I this case, it might be true that $\lim_{x\rightarrow \infty} f(x)=A$ implies that $\lim_{a\rightarrow \infty}I_a(f)=A$.
Does anybody have an idea to this?
Your approach is fine, including the fact that you noticed that there's a problem with $0$. But that problem is easy to solve: define $f(x)=A+\frac1{x+k}$, for some $k>0$. Then the problem will go away.