Let $X$ be a random variable with values in $[0,+\infty)$
Show that $E(X)=\int_{0}^\infty P(X \geq t) dt$
Hint: first show that the expected value of a random variable with values in $\mathbb{N}_{0}$ is given by $E(X)=\sum_{k=1}^\infty P(X \geq k)$.
I already proved the Hint, but I don't understand how to use it to prove the first statement. My approach would be the following:
from the definition we know that $E(X)=\int_{0}^\infty X dP$
now write $\int_{0}^\infty X dP=\int_{\mathbb{N}_{0}} X dP + \int_{\mathbb{R}_{\geq0}\setminus\mathbb{N}_{0}} X dP$
but here I get stuck because, even if we somehow success to use the hint to solve the first integral, i have no idea how to approach the second, but maybe my approach is totally wrong. I would be very grateful for any help you can give for solving this problem.
\begin{align} E[X] &= \int_{x = 0}^{\infty} f_X(x) \cdot x \,\mathrm{d}x \\ &= \int_{x = 0}^{\infty} f_X(x) \cdot \left( \int_{t = 0}^x 1 \,\mathrm{d}t \right) \,\mathrm{d}x \\ &= \iint_{\Omega} f_X(x) \,\mathrm{d}x \,\mathrm{d}t \tag*{Eq.(1)} \end{align} where $\Omega$ is the lower triangular region (below the diagonal $t = x$) in $x$-$t$ plane with $x$-axis being horizontal and $t$-axis being vertical.
Eq.$(1)$ above is doing the integration "vertical first". One can do this horizontal first such that
\begin{align} E[X] &= \iint_{\Omega} f_X(x) \,\mathrm{d}x \,\mathrm{d}t \\ &= \int_{t = 0}^{\infty} \left( \int_{x = t}^{\infty} f_X(x) \,\mathrm{d}x \right) \,\mathrm{d}t \\ &= \int_{t = 0}^{\infty} P(X \geq t) \,\mathrm{d}t \end{align} When you proved the discrete case earlier, you should have noticed the pattern that is often seen in triangular numbers. That pattern was supposed to be the hint for the continuous case, not splitting the reals into integers and non-integers.
For the discrete case, denote $P_k \equiv P( X = k )$, then \begin{align} E[X] &= \sum_{k = 1}^{\infty} k\cdot P_k \\ &= P_1 + P_2 + P_3 + P_4 + P_5 + \cdots + P_k + P_{k+1} + \cdots \\ &\hphantom{ {}={} } \hphantom{P_1} {}+ P_2 + P_3 + P_4 + P_5 + \cdots + P_k + P_{k+1} + \cdots \\ &\hphantom{ {}={} } \hphantom{P_1 + P_2 } {}+ P_3 + P_4 + P_5 + \cdots + P_k + P_{k+1} + \cdots \\ &\hphantom{ {}={} } \hphantom{P_1 + P_2 + P_3 } {}+ P_4 + P_5 + \cdots + P_k + P_{k+1} + \cdots \\ &\hspace{96pt}\vdots \\ &\text{at the $k$-th row} \hspace{69pt} {} + P_k + P_{k+1} + \cdots \\ &\hspace{139pt} {}+ P_{k+1} + \cdots \\ &\hspace{160pt} \vdots \end{align} Where each of the original summand $k \cdot P_k$ is now "aligned vertically" so that when looking at each row horizontally one gets $P( X \geq k)$. This mental picture is what you are supposed to have (and not just the algebraic manipulation).