Iirc, one of my professors offered the following proof for total expectation:
If $X \in L^1 (\Omega, \mathscr{F}, \mathbb{P})$ has pdf $f_X$ and $Y > \in L^1 (\Omega, \mathscr{F}, \mathbb{P})$ has pdf $f_Y$, then $E[E[X|Y]] = E[X]$, assuming $f_{X|Y=y}$ exists.
Pf: $LHS = \int_\mathbb{R} (E[X|Y=y]) f_Y(y) dy$
$=\int_\mathbb{R} (\int_\mathbb{R} x f_{X|Y=y} (x)) f_Y(y) dy$
$=\int_\mathbb{R}\int_\mathbb{R} x f_{X|Y=y} (x) dx f_Y(y) dy$
$=\int_\mathbb{R}\int_\mathbb{R} x f_{XY} (x,y) dx dy$
$=\int_\mathbb{R}\int_\mathbb{R} x f_{XY}(x,y) dy dx$ (*)
$=\int_\mathbb{R} x \int_\mathbb{R} f_{XY}(x,y) dy dx$
$=\int_\mathbb{R} x f_X dx$
$=RHS$
QED
Is that right?
If it is wrong, why?
If it is right, what is the justification for (*)?
I thought the justification is that
$$\int_\mathbb{R}\int_\mathbb{R} f(x,y) dx dy = \int_\mathbb{R}\int_\mathbb{R} f(x,y) dy dx$$
$\because f(x,y) \geq 0$ and by Tonelli's theorem for non-negative functions
but actually it may not extend to saying that
$$\int_\mathbb{R}\int_\mathbb{R} \color{red}{x} f(x,y) dx dy = \int_\mathbb{R}\int_\mathbb{R} \color{red}{x} f(x,y) dy dx$$
since $X \geq 0$ is not assumed.
My professor said that it has something to do with uniform or Lipschitz continuity. Does it?