Let $X$ be a random variable and let $\mathcal{G}$, $\mathcal{H}$ be two sub-$\sigma$-algebras. Consider the equation $$\mathbb{E}(\mathbb{E}(X|\mathcal{G})|\mathcal{H}) = \mathbb{E}(X|\mathcal{G}\cap\mathcal{H}) \text{ almost surely.}$$ I am tasked to show that the above holds in the following three cases: $\mathcal{G}\subseteq\mathcal{H}$, $\mathcal{H}\subseteq\mathcal{G}$, $\mathcal{G}$ and $\mathcal{H}$ are independent.
If we let $Y = \mathbb{E}(\mathbb{E}(X|\mathcal{G})|\mathcal{H})$ and take $A\in\mathcal{G}\cap\mathcal{H}$, it appears (unless I am making a mistake) that $\mathbb{E}(Y\mathbb{I}(A))=\mathbb{E}(X\mathbb{I}(A))$ (forgive the ugly indicator notation) holds generally, not just in the three cases above. Thus it remains to show that $Y$ is $(\mathcal{G}\cap\mathcal{H})$-measurable in the three cases, but I only see how to do this for the case $\mathcal{H}\subseteq\mathcal{G}$, as then $\mathcal{H}=\mathcal{G}\cap\mathcal{H}$ and $Y$ is of course $\mathcal{H}$-measurable. Any help for the other two cases would be greatly appreciated! Also perhaps an example of why this does not hold generally would be useful if someone could provide one.
If $\mathcal G \subseteq \mathcal H$, then $\mathbb E(X | \mathcal G)$ is $\mathcal H$-measurable, so $Y = \mathbb E(X | \mathcal G)$, and as $\mathcal G = \mathcal H \cap \mathcal G$, $Y$ is $\mathcal H \cap \mathcal G$-measurable.
If $\mathcal G$ and $\mathcal H$ are independent, then $\mathbb E(X | \mathcal G)$ is independent of $\mathcal H$, and so $Y$ is constant - thus, of course, $\mathcal H \cap \mathcal G$-measurable.
This should give an idea on how to construct counterexample in general case: take $\mathcal G$ and $\mathcal H$ with trivial intersection, but non-trivial dependencies.
I think the simplest example will be like this: let our probability space be $\{1, 2, 3\}$ with uniform measure, $X$ be identical, let $\mathcal G$ be generated by event $X = 1$ and $\mathcal H$ by $X = 2$.
Let $u = \mathbb E(X | \mathcal G)$. Then $u(1) = 1$ and $u(2) = u(3) = 2.5$.
From this we have $Y(1) = Y(3) = 1.75$ and $Y(2) = 2.5$.
On the right side, however, we have constant variable with value $2$.