[step:Factor the product integral by iterating Fubini]
For each $i\in\{1,\dots,n\}$, the integrability of $Y_i$ gives
\begin{align*}
\int_{\mathbb R}|t|\,d\mu_i(t)=\mathbb E[|Y_i|]<\infty.
\end{align*}
The preceding step shows that the coordinate product function $h:\mathbb R^n\to\mathbb R$ is integrable with respect to $\mu_1\otimes\cdots\otimes\mu_n$. Therefore the signed Fubini theorem applies to the finite product [measure space](/page/Measure%20Space) $(\mathbb R^n,\mathcal B(\mathbb R^n),\mu_1\otimes\cdots\otimes\mu_n)$.
For $k\in\{1,\dots,n\}$, define the partial product function $h_k:\mathbb R^k\to\mathbb R$ by
\begin{align*}
h_k(t_1,\dots,t_k):=\prod_{i=1}^k t_i.
\end{align*}
We prove by induction on $k$ that
\begin{align*}
\int_{\mathbb R^k} h_k(t_1,\dots,t_k)\,d(\mu_1\otimes\cdots\otimes\mu_k)(t_1,
\dots,t_k)=\prod_{i=1}^k\int_{\mathbb R} t\,d\mu_i(t).
\end{align*}
For $k=1$ this is the definition of $h_1$. Assume the identity holds for $k-1$, where $2\le k\le n$. Since $h_k=h_{k-1}\cdot t_k$ and $h_k$ is integrable with respect to $\mu_1\otimes\cdots\otimes\mu_k$, the signed Fubini theorem gives
\begin{align*}
\int_{\mathbb R^k} h_k\,d(\mu_1\otimes\cdots\otimes\mu_k)=\int_{\mathbb R}\left(\int_{\mathbb R^{k-1}} h_{k-1}(t_1,\dots,t_{k-1})t_k\,d(\mu_1\otimes\cdots\otimes\mu_{k-1})(t_1,
\dots,t_{k-1})\right)d\mu_k(t_k).
\end{align*}
For fixed $t_k\in\mathbb R$, the factor $t_k$ is constant with respect to the measure $\mu_1\otimes\cdots\otimes\mu_{k-1}$, so linearity of the integral gives
\begin{align*}
\int_{\mathbb R^{k-1}} h_{k-1}(t_1,\dots,t_{k-1})t_k\,d(\mu_1\otimes\cdots\otimes\mu_{k-1})(t_1,
\dots,t_{k-1})=t_k\int_{\mathbb R^{k-1}}h_{k-1}\,d(\mu_1\otimes\cdots\otimes\mu_{k-1}).
\end{align*}
Using the induction hypothesis, the right-hand side becomes
\begin{align*}
t_k\prod_{i=1}^{k-1}\int_{\mathbb R}t\,d\mu_i(t).
\end{align*}
The constant $\prod_{i=1}^{k-1}\int_{\mathbb R}t\,d\mu_i(t)$ is finite because each $Y_i$ is integrable. Pulling this constant outside the remaining integral gives
\begin{align*}
\int_{\mathbb R^k} h_k\,d(\mu_1\otimes\cdots\otimes\mu_k)=\prod_{i=1}^{k}\int_{\mathbb R}t\,d\mu_i(t).
\end{align*}
The induction proves the formula for $k=n$, hence
\begin{align*}
\int_{\mathbb R^n}\prod_{i=1}^n y_i\,d(\mu_1\otimes\cdots\otimes\mu_n)(y)=\prod_{i=1}^n\int_{\mathbb R}t\,d\mu_i(t).
\end{align*}
For each $i$, the definition of the law $\mu_i=\mathbb P\circ Y_i^{-1}$ gives
\begin{align*}
\int_{\mathbb R}t\,d\mu_i(t)=\int_\Omega Y_i(\omega)\,d\mathbb P(\omega)=\mathbb E[Y_i].
\end{align*}
Combining these identities yields
\begin{align*}
\mathbb E\left[\prod_{i=1}^n Y_i\right]=\prod_{i=1}^n\mathbb E[Y_i].
\end{align*}
Finally, since $Y_i=g_i(X_i)$ for each $i$, we obtain
\begin{align*}
\mathbb E\left[\prod_{i=1}^n g_i(X_i)\right]=\prod_{i=1}^n\mathbb E[g_i(X_i)].
\end{align*}
This is the desired factorization.
[/step]