Suppose a random variable Z has the following density: $$ g(x) = \frac{1}{2} \phi(x+1) + \frac{1}{2} \phi(x-1) $$ where $\phi(x)$ is the pdf of a standard normal random variable.
Prove that $Z$ has variance of $2$.
I can see that $Z$ can be thought of the sum of two normal random variables $N(-1,1)$ and $N(1,1)$ and so the mean of Z will be $0$. But how to calculate its variance? I guess that we need to calculate the covariance of the two components, but I am not sure how.
I will let you check that $EZ=0$ and show you how to compute $EZ^{2}$.
$$EZ^{2}=\int x^{2}g(x)dx=\frac 1 2\int x^{2}\phi (x+1)dx+\frac 1 2\int x^{2}\phi (x-1)dx$$ $$=\frac 1 2\int (y-1)^{2}\phi (y)dy+\frac 1 2\int (y+1)^{2}\phi (y)dy.$$ You can easily compute this by expanding the squares.
Recall that $\int y\phi (y)dy=0, \int \phi (y)dy=1$ and $\int y^{2}\phi (y)dy=1$.