Artificial intelligent assistant

Criterion for independency of random variables I saw in some notes the following "criterion" for independency of two random variables. Let $X$ and $Y$ be real-valued random variables defined on the same space. $X$ and $Y$ are statistically independent if and only if for any two functions $g$ and $h$ the following holds true $$ \mathbb{E}\left\\{ h(X)g(Y)\right\\} = \mathbb{E}\left\\{ h(X)\right\\}\mathbb{E}\left\\{ g(Y)\right\\}. $$ (1) Regard the "any two functions" requirement, what does it mean? (2) It is helpful to use this criterion to show that two random variables are dependent. I'm curious whether there is an example of showing that two random variables are independent, using this criterion?

1. "Any two functions" means Borel measurable functions (we need to integrate random variables) for which the integrals make sense (for example bounded functions). It's enough to do the test among $g$ and $h$ continuous bounded functions. Indeed, we can approximate pointwise the characteristic function of a closed set by a sequence of continuous bounded functions, hence if $F_1$ and $F_2$ are closed, we have $\mu\\{(X,Y)\in F_1\times F_2\\}=\mu\\{X\in F_1\\}\mu\\{Y\in F_2\\}$. Then we can extend this identity to $B_1$ and $B_2$ arbitrary Borel subsets.

2. Actually, it seems that we rather use the direction "$X$ independent of $Y$" implies $E[g(X)h(Y)]=E[g(X)]E[h(Y)]$ for $g,h$ measurable (bounded functions) than the converse. Indeed, for the latter, we check the equality when $g(x)=e^{isx}$ and $h(x)=e^{ity}$ for any $s,t\in\mathbb R$ fixed.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 39a63ecb29a0e8b3f38596fcec83649c