TITLE: How to prove this multivariable function is constant?
QUESTION [7 upvotes]: Suppose the multivariable function $z=f(x,y)$ is defined on $\mathbb R^2$, has continuous partial derivatives and always satisfies
$$x\frac{\partial f}{\partial x}(x,y)+y\frac{\partial f}{\partial y}(x,y)=0$$
Prove $z=f(x,y)$ is constant.
To be honest I don't quite know where to start. I tried rewriting the equation as a matrix multiplication
$$[x,y](\nabla f(x,y))=0$$
but this seems to be of little or no help.
Can anyone help me on this or give some hint that may push me further? Best regards!

REPLY [7 votes]: Let $g(t)=f(tx,ty)$. Then

 $$tg'(t)=tf(tx,ty)'=txf_x(tx,ty)+tyf_y(tx,ty)=0$$
 Therefore $g'(t)=0$, $t\neq0$, and by continuity also at $t=0$.

 Hence $f(x,y)=g(1)=g(0)=f(0,0)$.