Suppose $X$ is a random variable on some probability space $(\Omega, \mathcal{F}, \mathbb{P}), A$ is a set in $\mathcal{F}$, and for every Borel subset $B$ of $\mathbb{R}$, we have
$$
\int_A \mathbb{I}_B(X(\omega)) d \mathbb{P}(\omega)=\mathbb{P}(A) \cdot \mathbb{P}\{X \in B\} .
$$
Then we say that $X$ is independent of the event $A$.
Show that if $X$ is independent of an event $A$, then
$$
\int_A g(X(\omega)) d \mathbb{P}(\omega)=\mathbb{P}(A) \cdot \mathbb{E} g(X)
$$
for every nonnegative, Borel-measurable function $g$.