Is there a function $f : \mathbb{R}\to \mathbb{R}$ , $f>0$, $\lim_{x\to \infty}f(x) = \infty$ but $\int_{0}^{\infty}f(x)dx < \infty $? On another note, is there a function   $f : \mathbb{R}\to \mathbb{R}$ , $|f| =1$ but $\int_{0}^{\infty} f(x)\,dx = 0 $?
Edit: what if one were to relax the condition for the first question to $\limsup_{x\to \infty}f(x)\,dx = \infty$?
 A: As regards the first question, the answer is NO. Let $R>0$ such that $f(x)\geq 1$ for $x\geq R$. Then
$$\int_0^{\infty}f(x) dx\geq \int_R^{\infty}f(x) dx\geq \int_R^{\infty}1 dx=+\infty.$$
As regards the second question, the answer is YES.
Let $H_n=\sum_{k=1}^n 1/k$ for $n\geq 0$, and, for $x\geq 0$, let
$$
f(x)=
    \begin{cases}
      1 & \mbox{if  $x\in [2H_n,2H_n+\frac{1}{n+1}]$}, \\
      -1 & \mbox{if $ x\in (2H_n+\frac{1}{n+1},2H_n+\frac{2}{n+1})$}.
    \end{cases}
$$
Then $|f(x)|=1$ and $\int_0^{+\infty}f(x)=0$.
P.S.  If we relax the condition for the first question to $\limsup_{x\to \infty}f(x) = \infty$ then the answer is YES. Take for example
$$f(x)=e^{-x}+
    \begin{cases}
      n & \mbox{if  $x\in [n,n+1/n^3)$ for $n\in\mathbb{N}^+$}, \\
      0 & \mbox{otherwise}.
    \end{cases}
$$
then $f$ is positive and
$$\int_0^{+\infty}f(x)=\int_0^{+\infty}e^{-x}dx+\frac{1}{2}\sum_{n=1}^{\infty}\frac{n}{n^3}=1+\frac{\pi^2}{12}<+\infty.$$
A: No for the first question, yes for the second. For the first question, $\lim_{x\to \infty} f(x) = \infty$, and so there exists some $c\in \mathbb{R}$ such that for all $x\geq c$ we have $f(x) > 1$. Therefore,
$$\int_0^\infty f(x)\, dx =K+ \int_c^\infty f(x) \,dx > \int_c^\infty dx = \infty$$
for some appropriate real number $K$. 
For the second question, let $\mathrm{sgn}: \mathbb{R}\to \mathbb{R}$ such that $\mathrm{sgn}(x\geq0) = 1, \mathrm{sgn}(x< 0) = -1$. Then let $f(x) = \mathrm{sgn}(\sin(e^x))$. Clearly, $\vert f(x)\vert=1$ for all $x$. Further,
$$\int_0^\infty f(x) \, dx = \int_0^{\ln(\pi)}f(x)\, dx+\sum_{n=1}^\infty \int_{\ln(\pi n)}^{\ln(\pi(n+1))} f(x)\, dx$$
$$= \ln(\pi)+\sum_{n=1}^\infty (-1)^n (\ln((n+1)\pi) - \ln(n\pi)) \in \mathbb{R}$$
You can then modify $f$ so that the integral is $0$.
EDIT- To do this, suppose the integral comes out to $c>0$. Then let $g(x) = -1$ for $0\leq x < c$, and let $g(x) = f(x-c)$ for $x\geq c$. Then $\int_0^\infty g(x)\, dx = 0$. A similar process works if $c<0$.
