Measurable functions and expectation Let $X:(\Omega,F)\rightarrow (\Omega',F')$ be a random variable and $f:(\Omega',F')\rightarrow (\mathbb{R},B(\mathbb{R}))$ be measurable with $f\geq 0$ or $f(X)\in L^1(P)$. How do I show detailled:
$$
\mathbb{E}f(X)=\int f(X)dP = \int f(X)dP^X(dx)
$$
with $P^X$ being the distribution of $X$. I would like to understand this trough and through.

The standard way to show such equalities are first for simple functions, then for positive functions and finally for $L^1$ functions.
The first step should be relatively easier, and the equality for positive functions is by the Monotone convergence theorem, and the final step is by linearity of the integral and the fact that $f=f^+-f^-$, where $f^+,f^-$ are positive measurable functions.
Simple functions are linear sums of indicatir functions, and for indicator functions we have that:
$$\mathbb{E}[\mathbf{1}_{X\in A}]=\mathbb{P}(X\in A) $$ 
And the definition of the indicator function is precisely that which satisfies:
$$ \mathbb{P}(X\in A) = \int \mathbf{1}_{X\in A}dP^X(x) $$
