When can a function not be factored? Are there any general conditions under which a function involving $n$ unknowns cannot be factored into a product of $n$ terms each of which contains only one of the unknowns?
For example, $xy$ can be factored into $x$ and $y$ but we cannot factor $1/(1+xy)$ into a product of terms, each of which only contains $x$ or $y$ but not both. 
Besides looking at these functions on a case by case basis, I am wondering if anyone knows any general sufficient conditions to determine whether the factorization can definitely $\textit{not}$ hold.
Thanks!
 A: Nice question. Turns out to have a pretty nice answer too.
Theorem: Let $f:\mathbb R\to\mathbb R$. There exist $g,h:\mathbb R\to\mathbb R$ such that $f(x,y) = g(x)h(y)$ if and only if for all $x,x',y,y'\in\mathbb R$ we have
$f(x,y)f(x',y')=f(x,y')f(x',y)$.
proof: Suppose $g,h$ exists such that $f(x,y)=g(x)h(y)$. Then 
$$f(x,y)f(x',y')=g(x)h(y)g(x')h(y') = g(x)h(y')g(x')h(y) = f(x,y')f(x',y)$$
Now suppose that $f$ satisfies $f(x,y)f(x',y')=f(x,y')f(x',y)$ for all $x,x',y,y'$. If $f$ is identically $0$ we can just define $g$ and $h$ to be zero too so this case is trivial. If $f$ is not identically $0$ then find $a,b\in\mathbb R$ such that $f(a,b)\neq 0$. Then define $g(x) = f(x,b)$ and $h(y) = \frac{f(a,y)}{f(a,b)}$. Now we see that
$$g(x)h(y) = f(x,b)\frac{f(a,y)}{f(a,b)} = f(x,y)\qquad\square$$ 
This can be generalized to higher dimensions but the condition is a little trickier to write down. The condition becomes
$$f(x_1,\ldots x_n)f(x_1',\ldots,x_n')^{n-1} = \prod_{i-1}^n f(x_1',\ldots, x_{i-1}',x_i,x_{i+1}',\ldots,x_n')$$
