Let $X$ and $Y$ be real-valued random variables. Does it hold that $X$ and $Y$ are independent if and only if $\textrm{Cov}(f(X), g(Y)) = 0$ for all $f,g$ measurable functions?
One direction is obvious and it seems to me like the other direction should hold aswell but a proof eludes me. Does this hold for random variables with values in more abstract spaces (Hilbert / Banach)?
For real $t,u$ take $f(x)=\exp(itx)$ and $g(y)=\exp(iuy)$ to obtain $\phi(t,u)=\phi(t,0)\phi(0,u)$, where $\phi$ is the characteristic function of the joint distribution of $(X,Y)$.
More generally. $X$ and $Y$ are independent if, for all measurable $A$ and $B$, $P((X,Y)\in A\times B)=P(X\in A) P(Y\in B)$. So let $f=\chi_A$ and $g=\chi_B$, so that $$\begin{gather} Ef(X)=P(X\in A)\\ Eg(Y)=P(Y\in B)\\ Ef(X)g(Y)=P((X,Y)\in A\times B). \end{gather}$$ Thus, $\text{Cov}(f(X),g(Y))=0$ for all measurable $f$, $g$ implies $X$ and $Y$ independent.