If $\displaystyle X$ is a random variable on some probability space $\displaystyle (\Omega, \mathcal{F},P)$, $\displaystyle A $ is a set in $\displaystyle \mathcal{F}$, and for every Borel subset $\displaystyle B$ of $\displaystyle \mathbb{R} $, we have

$\displaystyle \int_{A} I_{B}(X(\omega)) \, dP(\omega) = P(A) \cdot P(X\in B) $

then we say that $\displaystyle X$ is independent of $\displaystyle A$.

Show that if $\displaystyle X$ is independent of an event $\displaystyle A$ then

$\displaystyle I = \int_{A} g(X(\omega)) \, dP(\omega) = P(A) \cdot E\left[g(X)\right] $.

I tried:

$\displaystyle I = P(A) \cdot \int_{\mathbb{R}} g(x) \, d\mu_{X}(x) = P(A) \cdot E\left[g(X)\right] $, just from the definition given.

Here $\displaystyle \mu_{X}(x)$ denotes the distribution measure.

Help appreciated