I have shown that if $h$ is an integrable function with respect to the measure $\mu$, and $X$ is a random variable on the usual probability space, then $Eh(X) = \int h \ d\mu$. I am wondering how this extends to: if $X$ has density $f$, then $$Eh(X) = \int_\mathbb{R} h(x)f(x) \ d x$$
which is the usual high school definition of expectation. I'm not really sure how to show this using the definition of density
The probability density $f$ is just the Radon-Nikodym derivative of $\mu$ with respect to the relevant measure (e.g. Lebesgue measure for a random variable taking values in $\mathbb{R}$).