[proofplan]
We write each value $X(\omega)$ as the one-dimensional Lebesgue measure of the interval of thresholds $t$ lying below it. This converts $X$ into an integral of the indicator of the subgraph set $\{(\omega,t):t<X(\omega)\}$. Since that indicator is nonnegative and measurable on the product probability-Lebesgue space, Tonelli's theorem permits exchanging the order of integration. The inner integral over $\Omega$ is exactly the tail probability $\mathbb P(X>t)$.
[/proofplan]
[step:Declare the product space and the measurable subgraph indicator]
Let $(\Omega,\mathcal F,\mathbb P)$ be the probability space in the statement. Let $\mathcal B(\mathbb R)$ denote the Borel $\sigma$-algebra on $\mathbb R$, let $\mathcal B([0,\infty)):=\mathcal B(\mathbb R)|_{[0,\infty)}$ denote the Borel $\sigma$-algebra on $[0,\infty)$, and let
\begin{align*}
X:(\Omega,\mathcal F)&\to([0,\infty),\mathcal B([0,\infty)))
\end{align*}
be the given measurable map. Let $\mathcal F\otimes\mathcal B([0,\infty))$ denote the product $\sigma$-algebra on $\Omega\times[0,\infty)$, and let $\mathbb P\otimes\mathcal L^1|_{[0,\infty)}$ denote the product measure.
Define the open subset
\begin{align*}
H:=\{(x,t)\in[0,\infty)\times[0,\infty):t<x\}.
\end{align*}
Define the map
\begin{align*}
G:(\Omega\times[0,\infty),\mathcal F\otimes\mathcal B([0,\infty)))&\to([0,\infty)\times[0,\infty),\mathcal B([0,\infty))\otimes\mathcal B([0,\infty)))\\
(\omega,t)&\mapsto (X(\omega),t).
\end{align*}
The first coordinate of $G$ is $X$ composed with the projection $\Omega\times[0,\infty)\to\Omega$, and the second coordinate is the projection $\Omega\times[0,\infty)\to[0,\infty)$; both are measurable, so $G$ is measurable. Hence the set
\begin{align*}
A:=G^{-1}(H)=\{(\omega,t)\in\Omega\times[0,\infty):t<X(\omega)\}
\end{align*}
belongs to $\mathcal F\otimes\mathcal B([0,\infty))$. Define its indicator function
\begin{align*}
\mathbb 1_A:\Omega\times[0,\infty)&\to\{0,1\}\\
(\omega,t)&\mapsto
\begin{cases}
1,&(\omega,t)\in A,\\
0,&(\omega,t)\notin A.
\end{cases}
\end{align*}
Then $\mathbb 1_A$ is a nonnegative measurable function on the product measure space.
[/step]
[step:Represent $X$ as the measure of its threshold interval]
For each $\omega\in\Omega$, the section
\begin{align*}
A_\omega:=\{t\in[0,\infty):(\omega,t)\in A\}
\end{align*}
equals $[0,X(\omega))$. Therefore, by the definition of one-dimensional Lebesgue measure on intervals,
\begin{align*}
\int_0^\infty \mathbb 1_A(\omega,t)\,d\mathcal L^1(t)
=
\mathcal L^1([0,X(\omega)))
=
X(\omega).
\end{align*}
Integrating this identity with respect to $\mathbb P$ gives
\begin{align*}
\mathbb E[X]
=
\int_\Omega X(\omega)\,d\mathbb P(\omega)
=
\int_\Omega\int_0^\infty \mathbb 1_A(\omega,t)\,d\mathcal L^1(t)\,d\mathbb P(\omega),
\end{align*}
where the equality is an equality of extended nonnegative integrals.
[/step]
[step:Apply Tonelli to exchange the threshold and probability integrals]
The function $\mathbb 1_A$ is nonnegative and measurable on $(\Omega\times[0,\infty),\mathcal F\otimes\mathcal B([0,\infty)),\mathbb P\otimes\mathcal L^1|_{[0,\infty)})$. Thus [Tonelli's Theorem](/theorems/???) applies and yields
\begin{align*}
\int_\Omega\int_0^\infty \mathbb 1_A(\omega,t)\,d\mathcal L^1(t)\,d\mathbb P(\omega)
=
\int_0^\infty\int_\Omega \mathbb 1_A(\omega,t)\,d\mathbb P(\omega)\,d\mathcal L^1(t).
\end{align*}
[guided]
The reason for introducing $\mathbb 1_A$ is that it is nonnegative, so Tonelli's theorem can be used without any prior integrability assumption. We verify the hypotheses carefully. The underlying product measure space is
\begin{align*}
(\Omega\times[0,\infty),\mathcal F\otimes\mathcal B([0,\infty)),\mathbb P\otimes\mathcal L^1|_{[0,\infty)}).
\end{align*}
In the first step, the set
\begin{align*}
A=\{(\omega,t)\in\Omega\times[0,\infty):t<X(\omega)\}
\end{align*}
was proved to belong to $\mathcal F\otimes\mathcal B([0,\infty))$. Therefore its indicator function
\begin{align*}
\mathbb 1_A:\Omega\times[0,\infty)&\to\{0,1\}
\end{align*}
is measurable. It is also nonnegative because its only possible values are $0$ and $1$.
Tonelli's theorem applies precisely to nonnegative measurable functions on product measure spaces. Applying it to $\mathbb 1_A$ gives
\begin{align*}
\int_\Omega\int_0^\infty \mathbb 1_A(\omega,t)\,d\mathcal L^1(t)\,d\mathbb P(\omega)
=
\int_0^\infty\int_\Omega \mathbb 1_A(\omega,t)\,d\mathbb P(\omega)\,d\mathcal L^1(t).
\end{align*}
This is the key step: it changes the viewpoint from fixing an outcome $\omega$ and measuring all thresholds below $X(\omega)$, to fixing a threshold $t$ and measuring the set of outcomes for which $X(\omega)>t$.
[/guided]
[/step]
[step:Identify the inner integral with the tail probability]
For each $t\in[0,\infty)$, define the event
\begin{align*}
E_t:=\{\omega\in\Omega:X(\omega)>t\}.
\end{align*}
Since $X$ is measurable and $(t,\infty)\cap[0,\infty)\in\mathcal B([0,\infty))$, we have $E_t=X^{-1}((t,\infty)\cap[0,\infty))\in\mathcal F$. For every $\omega\in\Omega$,
\begin{align*}
\mathbb 1_A(\omega,t)=\mathbb 1_{E_t}(\omega).
\end{align*}
Hence
\begin{align*}
\int_\Omega \mathbb 1_A(\omega,t)\,d\mathbb P(\omega)
=
\int_\Omega \mathbb 1_{E_t}(\omega)\,d\mathbb P(\omega)
=
\mathbb P(E_t)
=
\mathbb P(X>t).
\end{align*}
Combining this identity with the preceding two steps gives
\begin{align*}
\mathbb E[X]
=
\int_0^\infty \mathbb P(X>t)\,d\mathcal L^1(t).
\end{align*}
Both sides are extended nonnegative integrals, so the identity remains valid when their common value is $+\infty$. This proves the tail integral formula.
[/step]