The question is about the using of Fubini's theorem in the following proof.

Question 1 : Fubini's theorem for me looks like $$\int_Y \int_X f(x,y)dxdy=\int_X \int_Y f(x,y)dydx.$$ But I can not understand how they use it in the proof. Can you make this more clear for me? I dont understand how they get $\int_0^{|f(x)|}$
My attampt: STEP 1: We will use the next fact: If we have a function $f$ on the $E$ and $A\subset E$ then we have $$\int_E \chi_A f dx=\int_A f dx.(*)$$
Then $$p\int_0^{\infty}\alpha^{p-1}d_f(\alpha)d\alpha = p\int_0^{\infty}\alpha^{p-1}\int_X\chi_{\{x:|f(x)|>\alpha\}}d\mu d\alpha= \int_0^{\infty}\int_X p\alpha^{p-1}\chi_{\{x:|f(x)|>\alpha\}}d\mu d\alpha.$$
STEP 2: Then we say that it is hard (or imposible?) to integrate $\int_X\chi_{x:|f(x)|>\alpha}d\mu$ and change the order of integration $$\int_X\int_0^{\infty}p\alpha^{p-1}\chi_{\{x:|f(x)|>\alpha\}}d\alpha d\mu.$$ Then we use (*) in the inner integral and get $$\int_X\int_0^{|f(x)|}p\alpha^{p-1}d\alpha d\mu.$$ And so on.
Question 2: Is my steps correct?
I wrote and proved something similar in my old post. You may be able to get some idea from it. In probability theory, that proposition is known as Robin's theorem.
Show that $\mathbb{E}X^2<\infty$ if and only if $\sum_{n=1}^\infty n\cdot\mathbb{P}(|X|>n)<\infty$.