On conditional independence under transformation Let $X,Y,Z$ be integrable random variables on the same probability space.
If $X$ is independent of $Y$ conditionally on $Z$, i.e, $X|Z$ is independent of $Y|Z$, we know that for a measurable function $f$, we also have $f(X)|Z$ is independent of $f(Y)|Z$.
Under what extra conditions do we have $f(X)|f(Z)$ is independent of $f(Y)|f(Z)$ ?
I imagine that it holds if $f$ is injective since $\sigma(Z)=\sigma(f(Z))$ in that case. Is there a sufficient weaker condition that exploits the fact that we apply $f$ to all the random variables?
EDIT 4: Let $W$ be another integrable random variable on the same probability space. I am particularly interested in the case $E[W|X]$ is conditionally independent of $E[W|Y]$ given $E[W|Z]$. So $f$ would be the conditional expectation here. I am hoping whatever conditions we find on $f$ would translate into conditions on $W$ so that $E[W|X]$ is conditionally independent of $E[W|Y]$ given $E[W|Z]$ holds when $X$ is conditionally  independent of $Y$ given $Z$.
See my other related questions:
When is $\sigma(E[X|\mathcal F]) \subset \sigma(E[Y|\mathcal F])$? and
A martingale and mesurability problem
EDIT 3: What follows is false (thanks to Nate's comments and to question Is "conditional independence" of $\sigma$-algebras implied by "set-wise conditional independence" of $\sigma$-algebras?) and is not worth reading. The reader can focus on the above.
EDIT 1: $X$ is independent of $Y$ conditionally on $Z$ iff for all $A \in \sigma(X), B\in \sigma(Y), C \in \sigma(Z)$, $P(A\cap B | C)= P(A|C) P(B|C)$. [NOTE: THIS IS FALSE, the LHS is actually stronger than the RHS, see https://math.stackexchange.com/questions/3410023/is-conditional-independence-of-sigma-algebras-implied-by-set-wise-conditio?noredirect=1&lq=1 ] And $f$ is mesurable, $\sigma(f(\cdot)) \subseteq \sigma(\cdot)$.
Hence, for all $A \in \sigma(f(X)), B\in \sigma(f(Y)), C \in \sigma(f(Z))$, $P(A\cap B | C)= P(A|C) P(B|C)$. So $f(X)|f(Z)$ is independent of $f(Y)|f(Z)$. Can someone confirm ?
EDIT 2: I think the above  equivalence is wrong [Yes, it was, see the above link]. The correct one should be $X$ is independent of $Y$ conditionally on $Z$ iff for all $A \in \sigma(X), B\in \sigma(Y), \exists C \in \sigma(Z)$ such that $P(A\cap B | C)= P(A|C) P(B|C)$. [NOTE: THIS IS ALSO FALSE, see Nate's comment below]
So what needs to be shown is that if $A \in \sigma(f(X)), B\in \sigma(f(Y))$, there is a $C$ in $\sigma(f(Z))$ such that $P(A\cap B | C)= P(A|C) P(B|C)$.
 A: Too long for a comment.
By definition, $\mathscr{F}$ and $\mathscr{F}'$ are independent given $\mathscr{H}$ if for every pair of events $E, E'$ in $\mathscr{F}, \mathscr{F}',$ respectively, we have
$$
P(E \cap E' \mid \mathscr{H}) = P(E \mid \mathscr{H}) P(E' \mid \mathscr{H}).
$$
This means that for every event $H \in \mathscr{H},$ we have
$$
P(E \cap E' \cap H) = \int\limits_H P(E \mid \mathscr{H}) P(E' \mid \mathscr{H}) dP,
$$
this is quite different to what you have as "definition" in your EDIT 1.
Suppose $\mathscr{H} = \sigma(Z)$ and let $Z' = f(Z),$ $\mathscr{H}' = \sigma(Z').$ Clearly, $\mathscr{H}' \subset \mathscr{H}.$ You want to prove that for every $E, E'$ as before and $H'$ in $\mathscr{H}',$ the following equality occurs
$$
P(E \cap E' \cap H') = \int\limits_{H'} P(E \mid \mathscr{H}') P(E' \mid \mathscr{H}') dP.
$$
There does not seem to be a direct connection between this and what you want. (Note that when you actually have $\mathscr{F} = \sigma(X)$ and $\mathscr{F}' = \sigma(X')$ then you can prove that $f(X)$ and $f'(X')$ are independent given $\mathscr{H}$ easily since $\{f(X) \in A\}$ and $\{f'(X') \in A'\}$ belong to $\mathscr{F}$ and $\mathscr{F}',$ respectively, so your argument of restriction works smoothly.)
