Does strictly positive density function on the real line with infinite expected value exist? The problem is as stated in the title. I am looking for an example or a disproof, whether there exists a continuous density function on the whole real line with infinite expected value.
Once again:
The density function $f$ must be 
$1.$ Positive on $\mathbb{R}$
$2.$ Continuous on  $\mathbb{R}$
$3.$ $E[X]=\infty$ with $X\sim f$
 A: Expanding on my comment, consider the density
$$f(x) = \begin{cases}\displaystyle\frac{1}{\pi(1+x^2)}, & x > 0,\\
\displaystyle \frac{1}{\pi}\exp\left(-\frac{x^2}{\pi}\right),&x < 0,\\
\displaystyle\frac{1}{\pi}, & x = 0\end{cases}$$
which can be recognized as a standard Cauchy density on $\mathbb R^+$ and a
zero-mean normal density with variance $\frac{\pi}{2}$ on $\mathbb R^-$.
Note that $f(x)$ is positive and continuous on $\mathbb R$ as desired,
and more strongly, it also differentiable on $\mathbb R$ (at $x=0$,
both the left derivative and the right derivative have value $0$).
If $f(x)$ is not required to be differentiable everywhere (that is,
continuity is sufficient), we could, for example, set $f(x)$ to 
$\frac 1\pi\exp(2x/\pi)$
for $x<0$ instead of the normal density.
Thus,
$\displaystyle\int_0^\infty xf(x)\,\mathrm dx$ is unbounded while 
$\displaystyle \int_{-\infty}^0 xf(x)\,\mathrm dx =- \frac 12$,
and so $\displaystyle\int_\infty^\infty xf(x)\,\mathrm dx = E[X] = \infty$.
A: Start with the function $f(x) = \dfrac{1}{1+x^2}$. This is not quite right, because


*

*it's symmetric, so we don't get $E[X]=+\infty$;

*$\int_{\mathbb R}f \ne 1$.


But $\int_0^\infty xf(x)\mathrm{dx} = +\infty$, so you can modify it to meet your requirements:


*

*for negative arguments, change it to a function that tends to $0$ fast enough as $x \to -\infty$, e.g. $f(x)=e^x$ for $x < 0$;

*multiply it by a suitable constant so that $\int_{\mathbb R}f = 1$.

