So I don't understand the last part of how wikipedia proves the LOTUS theorem. Here is the link.
After we prove that,
$F_Y(y) = F_X(g^{-1}(y))$
It says by chain rule we have,
$F_Y(y) = f_X(g^{-1}(y)) * 1/g^{'}(g^{-1}(y))$
But didn't we get this by differentiating. This should be,
$dF_Y(y) = f_X(g^{-1}(y)) * 1/g^{'}(g^{-1}(y))$
Then the second last equation would be
$\displaystyle\int_{-\infty}^{\infty}g(x) f_X(x) dx = \displaystyle\int_{-\infty}^{\infty} y\,. dF_Y(y).dy$
Which makes sense. By definition the expected value of a function of random variable should be equal to the integral of the product of the value of the function of the random variable i.e. $y$ and the PDF of the function of the random variable $f_Y(y)$.