Problem saying that :
$f:\mathbb{R}^{n}\rightarrow\mathbb{R}$ is differentiable. Assume that there is a differentiable function $g:\mathbb{R}^{n}\rightarrow\mathbb{R}$ such that $\nabla f(x)=g(x)x$ . Show that $f$ is constant on $S=\{x\in\mathbb{R}^{n}:||x||=r\}$ where $r$ is positive constant.
For $x=(x_1,\dots ,x_n)$ and $\nabla f=(\frac{\partial f}{\partial x_{1}},\dots,\frac{\partial f}{\partial x_{n}})$, problem says $\frac{\partial f}{\partial x_{i}}=g(x)x_{i}$. It seems to me that to solve this problem, knowing the relation between norm of gradient and its value is crucial. How can I do?
Notification : This question is edited since it's about same problem and the former one is about just notation.