$\int_{0}^{\infty} f(x) \,dx$ exists. Then $\lim_{x\rightarrow \infty} f(x) $ must exist and is $0$. A rigorous proof? Let $f: \mathbb R \rightarrow \mathbb R $ be a continuous function such that $\int_{0}^{\infty} \,f(x) dx$ exists.
Then Prove that incase 
(i) $f$ is a non negative function, then $\lim_{x\rightarrow \infty} f(x) $ must exist and is $0$.
(ii) $f$ is a positive differentiable function , $\lim_{x\rightarrow \infty} f'(x) $ must exist and is $0$
$Attempt$: For the first part, i don't have a rigorous proof except for the fact that the given condition can be visualised geometrically. Since, the definite integral is actually calculating the area beneath the non negative function, the only way the given limit can exist when limit of f(x) itself tends to 0 at infinity.
Please give me a direction so that i can make this proof rigorous enough.
For the second part, i took an example. We know that ( leaving out the finite integration parts from $0$ to $1$ ..) $\int_{1}^{\infty} e^{-x^2} dx \leq \int_{1}^{\infty} e^{-x} dx$ and the latter converges.  But the derivative of $e^{-x^2} = (-2x)e^{-x^2}$ whose integration does not exist when x $\in~[1,\infty)$ as it's a monotonic function after a finite $x$.
Any help in providing rigor to the above proof will be very helpful
Thanks
 A: (i) Not true.
Let $g(x)=\max\{1-|x|,0\}$ which is continuous, nonnegative, and nonzero in $(-1,1)$, with $\int g=1$, and set
$$
f(x)=\sum_{n=1}^\infty g(2^nx-n).
$$
Then
$f$ is continuous, $f\ge 0$, $\int_{\mathbb R} f=1$ (since $\int g(2^n x-n)\,dx=2^{-n}$) and $\limsup_{x\to\infty} f(x)=1$.
(ii) Also not true. Take 
$$
g(x)=\left\{\begin{array}{lll}
\exp(1/(1-x^2)) &\text{if} & |x|<1, \\
0 & \text{otherwise}.
\end{array} 
\right.
$$ 
Set as before $f(x)=\sum_{n=1}^\infty g(2^nx-n)$.
Then $f$ is $C^\infty$, $f\ge 0$, $\int f<\infty$, and $\limsup_{x\to\infty}f'(x)>0$. 
A: This is false, the limit may not exist. Consider the infinite sum of $1/n^2$, and take a characteristic function of spikes in intervals of length $1/n^2$, zero otherwise. This integral, equal to $\sum 1/n^2$, converges, but the limit does not exist, not even in an almost-everywhere sense. What I think you mean is that a function in $L^1$ vanishes at infinity, which is to say that for all $\varepsilon>0$, $\mathcal{L}^n\{|f(x)|>\varepsilon\}$ is finite. If the limit of $f(x)$ does exist, then it is zero.
The condition that $f(x)\rightarrow 0$ as $x\rightarrow \infty$ is a neither necessary nor sufficient condition for integrability. The classical example is $1/x$. 
