The Expectation of a random variable $Z$ Given a probability triple $\left (\Omega,\mathcal{F},\mathbf{P}  \right )$,
$X$ and $Y$ are random variables form $\left (\Omega,\mathcal{F} \right )$ to $\left (\mathbb{R},\mathcal{B}\right )$.Let $A,B\in \mathcal{F}$,$A\cup B=\Omega$,$A\cap B=\emptyset$ and $\mathbf{P}\left ( A \right )=\mathbf{P}\left ( B \right )=1/2.$ Define a new random variable $Z$,such that $$Z=X\cdot\mathbf{1}_{A}+Y\cdot\mathbf{1}_{B}.$$
where $\mathbf{1}_{S}$ is a indicator of some event of $S\in \mathcal{F}.$

We know that $$\mathbf{E}(Z)=\mathbf{E}\left ( X\cdot\mathbf{1}_{A} \right )+\mathbf{E}\left (  Y\cdot\mathbf{1}_{B} \right )$$
I am not sure whether we have that $$\mathbf{E}\left ( X\cdot\mathbf{1}_{A} \right )=\mathbf{P}\left ( A \right )\cdot\mathbf{E}\left ( X\right );\quad \mathbf{E}\left ( Y\cdot\mathbf{1}_{B} \right )=\mathbf{P}\left ( B \right )\cdot\mathbf{E}\left (Y\right ).$$
It seems that $\left ( X,\mathbf{1}_{A} \right )$ is a pair of independent random variables,likewise $ \left (Y,\mathbf{1}_{B} \right ).$ If so, how to proof it rigorously?


$\textbf{Definition.}$
Let $\mu$ be a finite measure on $\mathcal{B}(\mathbb{R})$.The characteristic function of $\mu$ is the mapping from $\mathbb{R}$ to $\mathbb{C}$ given by
$$\phi(t)=\int_{\mathbb{R}}e^{itx}d\mu(x),t\in\mathbb{R}.$$
If $F$ is a distribution function corresponding to $\mu$,we shall also write $\phi(t)=\int_{\mathbb{R}}e^{itx}dF(x),$ and call $\phi$ the characteristic function of $F$(or of $X$ if $X$ is a random variable with distribution function $F$).

The above question arose from an exercise:

$\mathbf{Ex.}$ If $\phi$ is a characteristic function.Show that $\textrm{Re}(\phi)$ is characteristic function.

Solution. Let $X$ have characteristic function $\phi$, and let $Z$ be equal to $X$ with probaility 1/2 and to $Y:=-X$ otherwise. The characteristic function of $Z$ is given by
$$\phi_{Z}(t)=\frac{1}{2}(\mathbf{E}(e^{itX})+\mathbf{E}(e^{-itX}))=\frac{1}{2}(\phi_{X}(t)+ \overline{\phi_{X}(t)}).$$
I don't understand why $\phi_{Z}(t)=\frac{1}{2}(\mathbf{E}(e^{itX})+\mathbf{E}(e^{-itX}))?$
 A: For general random variables $X, Y$, the statement "It seems that $\left ( X,\mathbf{1}_{A} \right )$ is a pair of independent random variables,likewise $ \left (Y,\mathbf{1}_{B} \right )$" is obviously wrong.
For example, let $X \sim B(1, 0.5)$ be a Bernoulli random variable, $A = \{\omega: X(\omega) = 0\}$, $B = \{\omega: X(\omega) = 1\}$, then $A \cup B = \Omega, A \cap B = \varnothing, P(A) = P(B) = 1/2$. But $X$ and $I_A$ are clearly not independent, in particular, $E(XI_A) \neq  E(X)P(A) = \frac{1}{2} \times \frac{1}{2} = \frac{1}{4}$. In fact, by definition, $XI_A \equiv 0$, whence $E(XI_A) = 0$.
A: If $\phi$ is a characteristic function so is $Re \, \phi$. This is becasue $\phi(x)=\int e^{itx}d\mu(x)$ for some probability measure $\mu$ and $\nu (A)=\frac {\mu(A)+\mu(-A)} 2$ defines another probability measure. The characteristic function of $\nu$ is the real part of $\phi$.
(If you want to construct a r.v. whose characteristic function is $Re \, \phi$ you may have to outside the original sample space $\Omega$).
