Integrating a function wrt different measures Suppose that $(\Omega, \mathcal E, P)$ is a probability space and $X\colon \Omega \to \mathbb R$ is a RV defined on $\Omega$. Denote as $\mu\colon \mathcal B \to [0,1]$ the probability measure on $\mathbb R$ defined as $$\mu(I)=P(X^{-1}(I)).$$
Suppose that $\mu << dx$, by Radon-Nikodym theorem there exists $f \colon \mathbb R\to [0,+\infty]$ ($f$ is exactly the PDF of $X$) such that $$\mu(I)=\int_I f(x)dx.$$
Is it correct that, given $g\colon \mathbb R \to \mathbb R$, $$\int_\mathbb R g d\mu=\int _\mathbb R g(x)f(x)dx?$$
And if it is, why?
 A: Yeah it is correct. Prove it measure theoretic bootstrapping : that is first prove the formula taking $g$ to be any indicator function, then show that the set of functions $g$ which satisfies
$$\int_{\mathbb{R}}gd\mu=\int_{\mathbb{R}}g(x)f(x)dx$$
is closed under finite linear combinations and is a monotone class. Then as any bounded measurable function can be written as $h=h^{+}-h^{-}$ where $h^{+}$ and $h^{-}$ are respectively the positive and negative parts of $h$ and moreover any positive measurable function $h$ can be written as upper pointwise limit of simple functions (which are just finite linear combinations of simple functions), we have that the formula is true for all bounded measurable functions.
A: It is correct (with some assumption on $g$ of course, to make sure that the integral make sense). The proof uses a standard technique: when 
$$
g(x)=\chi_I(x)=\begin{cases} 1, & x\in I \\ 0 & x\notin I\end{cases},$$
the desired formula holds true by definition of $\mu$. Linearity ensures that the formula holds true for all simple functions, and a limiting argument ensures that the formula holds true for all functions $g$ for which the integrals make sense.
