I’m trying to get that $E[T] = \int_0^\infty(S(t))$ where $T$ is a positive continuous random variable and $S(t) = P(T \geq t)$. After some research (here and there), I know it is possible to proceed this way:
\begin{align*} E[T] = \int_0^\infty tf(t) dt &= \int_0^\infty \bigg(\int_0^tdu\bigg) f(t)\,dt \\\ &= \int_0^\infty \bigg(\int_u^\infty f(t)\,dt\bigg) du\\\ &= \int_0^\infty P(T \geq u)\,du\\\ &= \int_0^\infty S(t)\,du \end{align*}
Where, for justifying the third equality, we can use first Tonelli-Hobson test and then Fubini’s theorem. My doubts are related to the Tonelli-Hobson part. As I understand, the result must by applied to the function $g(t, u) = f(t)$ with domain $\{(t,u) : 0 \leq u \leq t\}$. We know that $\int_0^\infty \big(\int_0^t |g(t,u)| du\big) dt$ is finite because it is equal to $E[T]$, and this is supposed to exist. However, $g$ must be also measurable in order to verify all the hypothesis of the test. How can I prove that it is measurable? Obviously, $f(t)\chi_{[0, \infty]}$ is integrable, can I proceed from this?