Solution (source code)

= Solution

If $\mathcal G\subseteq\mathcal H$, then $\mathbb E[X\mid\mathcal G]$ is already $\mathcal H$-measurable, so
$$
\mathbb E[\mathbb E[X\mid\mathcal G]\mid\mathcal H]
=\mathbb E[X\mid\mathcal G]
=\mathbb E[X\mid\mathcal G\cap\mathcal H].
$$
If $\mathcal H\subseteq\mathcal G$, the <tower property of conditional expectation> gives
$$
\mathbb E[\mathbb E[X\mid\mathcal G]\mid\mathcal H]
=\mathbb E[X\mid\mathcal H]
=\mathbb E[X\mid\mathcal G\cap\mathcal H].
$$
Finally, if $\mathcal G$ and $\mathcal H$ are independent, the $\mathcal G$-measurable variable $\mathbb E[X\mid\mathcal G]$ is independent of $\mathcal H$. Its conditional expectation given $\mathcal H$ is its mean $\mathbb E[X]$. Part c shows that the right side is also $\mathbb E[X]$.