Independence of random variables product of expectations proof I want to prove that $X_1$ and $X_2$ are independent if and only if for all continuous and positive functions $f_1$ and $f_2$
$$\mathbb{E}[f_1(X_1)f_2(X_2)]=\mathbb{E}[f_1(X_1)]\mathbb{E}[f_2(X_2)]$$
The forward direction is direct. We get
$$
    \mathbb{E}[f_1(X_1)f_2(X_2)] = \cdots= \mathbb{E}[f_1(X_1)]\mathbb{E}[f_2(X_2)]$$
by choosing the appropriate $f_i,i=1,2$. However I'm not sure how to start the other direction. Maybe approaching the indicator function on the set $(-\infty, x]$ by a sequence of continuous and bounded functions? Any help is welcome. Thanks!
 A: Let $g$ be any positive, continuous and bounded function and let $t \in \mathbb R$. Define $$ f_n(x) := \begin{cases} 1 & x\le t \\ 1+n(t-x) & x\in \left(t,t+\frac{1}{n}\right] \\ 0 & x > t+\frac{1}{n} \end{cases}$$
Then $f_n \to 1_{(-\infty,t]}$ a.e, hence by Dominated Convergence Theorem $$ \mathbb E[1_{(-\infty,t]}(X_1)g(X_2)] \xleftarrow{\infty \leftarrow n}{}\mathbb E[f_n(X_1)g(X_2)] = \mathbb E[f_n(X_1)]\mathbb E[g(X_2)] \xrightarrow{n \to \infty}{} \mathbb P(X_1 \le t)\mathbb E[g(X_2)]$$
Now, given $t \in \mathbb R, s \in \mathbb R$ we choose similar sequence of functions $g_n$ converging a.e to $1_{(-\infty,s]}$ and arguing as before we get $$\mathbb P(X_1 \le t,X_2 \le s) \xleftarrow{\infty \leftarrow n}{}\mathbb E[1_{(-\infty,t]}(X_1)g_n(X_2)] = \mathbb P(X_1 \le t)\mathbb E[g_n(X_2)] \xrightarrow{n \to \infty}{} \mathbb P(X_1 \le t)\mathbb P(X_2 \le s)$$
It's a common fact (proof by Monotone class/Dynkin system) that if CDF of a random variable $(X_1,X_2)$ has this multiplicative property (i.e $\mathbb P(X_1 \le t,X_2 \le s)= \mathbb P(X_1 \le t)\mathbb P(X_2 \le s)$ for any $t,s \in \mathbb R$) then $X_1,X_2$ are independent.
The other implication is rather trivial, as you said, since independence of $X_1,X_2$ implies independence of $f_1(X_1),f_2(X_2)$ for any borel functions $f_1,f_2$.
