Is there a function $\displaystyle f(x)$ of class $\displaystyle C^{\infty}$ defined on $\displaystyle (0,\infty)$ such that $\displaystyle \lim_{x\to0}f(x)=\infty$ and $\displaystyle \int_0^{\infty}f(x)\,dx$ exists and is finite?

I found a function:

$\displaystyle f(x)=\left\{\begin{array}{lr}\frac{1}{\sqrt{x}}:&0 <x\leq1\\e^{\frac{1-x}{2}}:&1\leq x<\infty\end{array}\right\}$

which fits everything except it's only class $\displaystyle C^1$ (because $\displaystyle f''(1)$ DNE).

Any ideas? I'm sure such a function exists; I'm just not sure whether it can be expressed in terms of elementary functions.

This is not a homework problem; I was just thinking.