Is that true that not every function $f(x,y)$ can be writen as $h(x) g(y)$? [closed]

If not, why? Here $h$ and $g$ are two general function.


One thing must happen if we know $f(x,y) = g(x) h(y),$ which is that we must get equality on diagonals for four points in a rectangle: suppose we have the four points $(a,b),$ $(c,b),$ $(a,d), $ $(c,d).$ We must have $$ f(a,b) f(c,d) = f(a,d) f(c,b), $$ because $f(x,y) = g(x) h(y)$ means both sides equal $g(a)g(c)h(b)h(d).$

First we take the easiest example, $f(x,y) = x+y.$ The left hand side of $$ f(a,b) f(c,d) = f(a,d) f(c,b) $$ is $(a+b)(c+d) = ac + ad+bc+bd. $ The right hand side is $(a+d)(c+b) = ac + ab+cd+bd. $ For concreteness, take $a=1,$ $b=10,$ $c=100,$ $d=1000.$ The two values are not equal.

The cocycle condition is also sufficient. If we always have $f(x,y)=0,$ then take $g(x) = 0,$ $h(y) = 0.$

If, instead, there is some point such that $f(A,B) \neq 0,$ we can continue by using $$ f(x,y) f(A,B) = f(x,B) f(A,y). $$ Therefore define $$ g(x) = \frac{f(x,B)}{f(A,B)}, $$ $$ h(y) = f(A,y). $$ This way, $$ g(x) h(y) = \frac{f(x,B) f(A,y)}{f(A,B)}.$$