I found the following theorem in Allan Gut, Probability theory (without proof): Let $X$ be a nonnegative random variable and $g$ a nonnegative differentiable strictly increasing function. Then $$Eg(X)=g(0)+\int_{(0,\infty)}g'(x) \mathbb{P}(X>x)\,dx,$$ and $$Eg(X)<\infty\Longleftrightarrow \sum_{n=1}^\infty g'(n)\mathbb{P}(X>n)<\infty.$$
The first statement I could prove (let $X\sim F$):
\begin{eqnarray*} Eg(X)=\int_{(0,\infty)} g(x)dF(x) & =\int_{(0,\infty)} \int_{(0,x)}g'(t)\,dt\,dF(x)+g(0)\\[8pt] & =g(0)+\int_{(0,\infty)}g'(t) \mathbb{P}(X>t)\,dt, \end{eqnarray*} by Fubini. But I am struggling with the second statement. My idea is the following: $$Eg(X)=\int_{(0,\infty)} g(x)\,dF(x)=\sum_{k=1}^\infty \int_{(n_k,n_{k+1})} g(x) \, dF(x).$$
for some increasing sequence satisfying $\cup_{k=1}^\infty [n_k,n_{k+1}] = \mathbb{R^+}$. But i cannot find the appropriate sequence. any suggestions? Thank you.
