I'm trying to prove the following identity:
If $f:X \rightarrow \mathbb{R}$ is a bounded, continuous function, and $\mu$ is a borel measure in $X$, then
$\int f d\mu = \int_0^1 \mu(\{x \in X ; f(x)>t\})dt$.
(W/ loss of generality, one may consider $0\leq f\leq 1$.
This equality is used to prove one of the portmanteau theorem affirmations, as in chapter 8 of Gordan Z.'s lecture notes:
https://web.ma.utexas.edu/users/gordanz/notes/theory_of_probability_I.pdf
As he says, it is a particular case of Problem 5.23, but i'm trying to obtain it by scratch.
My attempt was: name the set $A_t=\{x \in X ; f(x)>t\} $.
Then $ \int_0^1 \mu(A_t)dt= \int_0^1 \int \mathcal{X}_{A_t} d\mu dt=\int \int_0^1 \mathcal{X}_{A_t} dt d\mu$.
Then it remains to prove that $\int_0^1 \mathcal{X}_{A_t} dt $ is equal to $f$, but I got stuck at this point.