Product of continuous functions in two distinct variables dense 
Let X be the space of all continuous functions in two variables $x$ and $y$. Then is the subspace Y consisting of functions of the form $f(x)g(y)$ (where both $f,g$ are continuous) dense in X? So more general is this true for $n$ variables?

 A: Not in the usual metric (i.e., the one given by the supremum norm). 
If $h(0,0)=h(1,1)=0$ and $h(1,0)=h(0,1)=1$ then for any $f,g$ with $\|h(x,y)-f(x)g(y)\|_\infty<\epsilon<\frac12$, none of the values $f(0),f(1),g(0),g(1)$ can be $=0$. Then 
$$\left|\frac{g(1)}{g(0)}\right|=\frac{|f(1)g(1)|}{|f(1)g(0)|}<\frac{|h(1,1)|+\epsilon}{||h(1,0)|-\epsilon|}=\frac{\epsilon}{1-\epsilon}<1 $$
and 
$$\left|\frac{g(0)}{g(1)}\right|=\frac{|f(0)g(0)|}{|f(01)g(1)|}<\frac{|h(0,0)|+\epsilon}{||h(0,1)|-\epsilon|}=\frac{\epsilon}{1-\epsilon}<1 ,$$
which is absurd.

The same argument works for any other topology on $X$ for  which convergence implies pointwise convergence, and apparently even if we allow $f,g$ to be non-continuous.
A: It is not true in the product topology on $\mathbb{R}^{\mathbb{R}^2}$, hence also not true in any finer topology (such as the one induced by supremum norm). The intuition behind this is that the functions satisfying a non-trivial equation form a closed proper subspace, which therefore cannot be dense, similarly to how a plane such as $\pi: x + y + z = 1$ cannot be dense in $\mathbb{R}^3$.
Namely if $h(x, y) = f(x) g(y)$ for all $x, y \in \mathbb{R}$, then
$$h(0, 0) \cdot h(1, 1) = h(1, 0) \cdot h(0, 1).$$
Hence the set of all functions $h(x, y)$ of the form $f(x) g(y)$ is contained in the set
$$\{ h : \mathbb{R}^2 \to \mathbb{R} \mid h( 0, 0) \cdot h(1, 1) = h(1, 0) \cdot h(0, 1) \}$$
which is closed in the product topology on $\mathbb{R}^{\mathbb{R}^2}$ and clearly it's a proper subset, so it cannot be dense. 
