Let $f,g,h$ be mesurable and (at least) continuous functions, $Z$ and $X$ two random variables.
I am looking for the sufficient and necessary conditions on $g$ for the following equality to be true for all $X$ and $Z$:
$$\mathrm{Var}(\mathbb E[h(g(X),Z)|g(X)]) = \mathrm{Var}(\mathbb E[h(g(X),Z)|X]), $$
Thanks
The following equality
$$\mathbb E[g(X)|g(X)] = \mathbb E[g(X)|X] $$
is true for all random variable $X$ and for all measurable function $g$.
Hence, if $h$ is measurable too, the following holds:
$$\mathbb E[h(g(X),Z)|g(X)] = \mathbb E[h(g(X),Z)|X]. $$
It proves that your equality is true if $h$ and $g$ are both measurable.