Let $X$, $Y$ and $Z$ be random variables, with $Z$ independent from $X$ and from $Y$ (i.e. $P(X≤x,Z≤z) = P(X≤x)P(Z≤z)$ and $P(Y≤y,Z≤z) = P(Y≤y)P(Z≤z)$).
Is it true that a function $f(X,Y)$ is independent from $Z$ (i.e. $P(f(X,Y) ≤ a, Z ≤ z) = P(f(X,Y) ≤ a)P(Z ≤ z)$)?
I'm asking this question because a proof I'm studying derived the independence of sample variance ($s^2$) and sample mean ($m$) from the fact that differences $X_i - m$ were independent from $m$, and $s^2$ was a function of $X_1 - m,...,X_n - m$.
EDIT: I forgot to add that the sample is supposed to be random normal, but that wasn't the main point of my question. I understand all the proof, save that step I mentioned.