Dense subset of $L^2$ of product space with separated variables? Let $X$ and $Y$ be compact subsets of $\mathbb{R}^d$, let $\mu$ and $\nu$ be finite Borel measures on $X$ and $Y$, resp. 
Is it possible to find a dense subset of $L^2(X \times Y)$ consisting of functions of the form $fg$ where $f \in L^2(X)$ and $g \in L^2(Y)$? Can the subset be taken to be countable?
Edit: The answer is yes if for every simple function $h \in L^2(X \times Y)$ and every $\epsilon > 0$, there are simple functions $f \in L^2(X)$ and $g \in L^2(Y)$ such that $\|h-fg\|_2 < \epsilon$. 
For the situation, I have in mind $\mu$ is Lebesgue measure.
The following argument gives something close but not quite good enough: If $\{f_n\}$ is an orthonormal basis for $L^2(X)$ and $\{g_m\}$ is an orthonormal basis for $L^2(Y)$, then $\{f_n g_m\}$ is an orthonormal basis for $L^2(X\times Y)$, so that the set of all finite linear combinations $\{f_n g_m\}$ is dense in $L^2(X \times Y)$. See Orthonormal basis for product $L^2$ space
 A: By $fg$, I am assuming you mean functions of the form $f(x)g(y)$. In this case the answer is no, such functions are not dense in $L^2(X \times Y)$. I will give an algebraic proof of this fact (though I am sure that analytic proofs exist).
As a Hilbert space, $L^2(X \times Y)$ is isometrically isomorphic to $L^2(X) \otimes L^2(Y)$ and functions of the form $f(x)g(y)$ are precisely the simple tensors $f \otimes g$ in this Hilbert space.
In general, the simple tensors are most certainly not dense in a tensor product of two Hilbert spaces.
Indeed, given two Hilbert spaces $H$ and $K$, we know that $K \simeq K^*$ isometrically, and thus $K \otimes H \simeq K^* \otimes H \simeq \text{HS}(K,H) $ isometrically, where the latter space is the space of Hilbert-schmidt operators from $K$ to $H$ equipped with the Hilbert Schmidt norm $\|A\|_{\text{HS}}^2 :=$ tr$_K(A^*A)=$tr$_H(AA^*)$. One may check that the simple tensors in $\text{HS}(K,H)$ are precisely the bounded linear maps whose image has dimension $1$. In general, a limit of rank-one operators always has rank one or zero (more generally, the rank can only shrink under pointwise convergence of operators; this may be proved by contradiction, first supposing that the limit of some family of operators has rank $k$ but all prelimits have rank $k-1$ or less; then by picking a basis for the image of the limiting operator, one may obtain the contradiction by showing that a certain collection of determinant-zero matrices converges to a full-rank $k\times k$ matrix). Now, as long as $H$ and $K$ both have dimension greater than $1$, there are certainly Hilbert-Schmidt operators from $K\to H$ which have rank greater than $1$, hence these cannot be a limit of simple tensors.
Note: This answer was incorrectly written before 18 May 2019.
