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$.