Improper integrals: is it possible to have a non bounded function such that its improper integral converges? Find an example of a non-negative function $(f\geq 0)$ which is continuous and such that $\int_{0}^{\infty}f(x)dx$ is finite ($\int f < \infty$) but $\lim_{x\rightarrow\infty}f(x)$ does not exist. 
Also, is it possible that $\int_{0}^{\infty}f(x)\,dx$ exist but $f(x)$ is not bounded?
 A: Hint:
Let the graph of $f$ consist of a sequence of disjoint isosceles triangles of height $n$ and base length $\frac{1}{n 2^{n}}$. The area of the $n$-th triangle is $$\frac{1}2 \cdot n \cdot \frac{1}{n2^{n}} = \frac{1}{2^{n+1}}$$
so the integral is $$\int_0^\infty f(x)\,dx = \sum_{n=1}^\infty \frac{1}{2^{n+1}} = \frac12 <+\infty$$
However, $f$ is clearly unbounded. Also $\lim_{n\to\infty} f(x)$ does not exist.
A: $$ f(x) = \sum_{n\geq 1} n e^{-n^6(x-n)^2} $$
is a continuous and non-negative function, which is unbounded over $\mathbb{R}^+$ (since $f(n)\geq n$) and such that
$$ \int_{\mathbb{R}^+}f(x)\,dx \leq \int_{\mathbb{R}}f(x)\,dx = \sum_{n\geq 1}\frac{\sqrt{\pi}}{n^2} = \frac{\pi^{5/2}}{6} < +\infty. $$
$\hspace1in$
A: Define a non-negative continuous and unbounded function $f$ such that $\int_{k}^{k+m}f(x)\, dx=\frac1{k^\alpha}$ for $k,m\in\Bbb N$, then you will had that
$$\int_0^\infty f(x)\, dx=\sum_{k=1}^\infty\frac1{k^\alpha}<\infty,\quad\text{when }\alpha>1$$
By example the non-negative and unbounded continuous function defined by
$$f(x):=\begin{cases}(k+1)(x-k)^{(k+1)^3},&x\in[k,k+1],\,k\text{ non-negative and even}\\k(k+1-x)^{k^3},&x\in[k,k+1],\,k\text{ non-negative and odd}\end{cases}$$
Then we found that
$$\int_k^{k+2}f(x)\, dx=2(k+1)\int_0^1 x^{(k+1)^3}\, dx=2\frac{k+1}{(k+1)^3+1}$$
Hence
$$0\le\int_0^\infty f(x)\, dx=2\sum_{k=0}^\infty\frac{k+1}{(k+1)^3+1}<\infty$$
