Expected value, I do not get this "wikipedia triviality" on wikipedia are two definitions of the expected value for some random variable $E(X)=\int t f_X(t) dt$ and $E(X)=\int X dP$. I do not see how they are equivalent. In cases, that $X$ would be differentiable, then integration by substitution would do it. I mean honestly, wikipedia sounds as if this would be true for all sorts of random ariables if they have a density function.
here is the reference
I am interested in the case when the the random variable has a continuous( and even differentiable) density function $f_X$. $X$ should be either just measurable or continuous, whatever you need to derive this equality. 
 A: By definition (essentially), a density function for a random variable $X$ is precisely the Radon-Nikodym derivative of the probability measure on $\mathbb{R}$ induced by $X$.  So, this fact amounts entirely to the following claim:
Lemma: Let $\mu$ be a Borel probability measure on $\mathbb{R}$ which is absolutely continuous with respect to Lebesgue measure $\lambda$. (So that by Radon-Nikodym, there is a function $f$ with $\mu(A)=\int_A f\,d\lambda$ for all measurable $A$.)  Then for any $\mu$-measurable, integrable function $g$,
$$
\int_\mathbb{R} g\,d\mu=\int_{\mathbb{R}}g\cdot f\,d\lambda.
$$
The proof of this follows the "usual" outline for such proofs in measure theory:


*

*Show that it works when $g$ is the indicator of a measurable set.

*Use this to show that it works when $g$ is a linear combination of a sum of such indicators.

*Use this to show that it works for non-negative measurable $g$, by writing them as limits of increasing sequences of functions from (2).

*Use this to show that it works for any integrable $g$.


Note that this doesn't require any assumptions on $f$ (and therefore for your probability density $f_X$) other than being the density for your measure.  No continuity required, much less differentiability!
