# Independence of multivariable function of random variables on the information

It might be this question was asked before, but I still want to request an answer in measure-theoretic framework.

Let's define a probability space $\{\Omega, \mathcal{F}, \mathbb{P}\}$ and $\sigma$-algebra $\mathcal{G} \subset \mathcal{F}$. Random variables $X$ and $Y$ are independent on $\mathcal{G}$. Is random variable $Z = f(X,Y)$ independent of $\mathcal{G}$ too? If so, how to prove it. What are the constraints on $f$? What does it mean $f$ is a measurable function (two variables are here)?

Let $X_1$ and $X_2$ be two independent identically distributed random variables taking the values $1$ and $-1$ with probability $1/2$. Let $X:=X_1$, $Y:= X_1X_2$, $\mathcal G$ be the $\sigma$-algebra generated by $X_2$ and $f\colon\left(x,y\right)\mapsto xy$. Then $X$ is independent of $\mathcal G$, and $Y$ is independent of $\mathcal G$ as well but $Z:=f\left(X,Y\right)=X_1^2X_2=X_2$ is not independent of $\mathcal G$.