Show there exists differentiable $g : (0, \infty) \to \mathbb{R}$ s.t $f(\vec{x}) = g(||\vec{x}||)$ for $f : \mathbb{R}^3 \to \mathbb{R}$ 
Let $f : \mathbb{R}^3 \setminus \left \{0 \right \} \to \mathbb{R}$ be a differentiable function s.t $\nabla f \neq 0$ and:
$y \frac{\partial f}{\partial x} -  x \frac{\partial f}{\partial y} =0 \\
z \frac{\partial f}{\partial y} -  y \frac{\partial f}{\partial z} =0$
Show there is a differentiable $g : (0, \infty) \to \mathbb{R}$ s.t $f(x,y,z) = g(||(x,y,z)||)$

I tried using spherical coordinates to show that the gradient is only determined by $r$ which I think should help, but I had some trouble with the algebra, help appreciated.
 A: Define $g(r,\theta,\phi) := f(r\sin\theta\cos\phi, r\sin\theta\sin\phi, r\cos\theta)$.
Our assumptions say
$$\frac{\partial f}{\partial x}r\sin\theta\sin\phi = \frac{\partial f}{\partial y}r\sin\theta\sin\phi$$
$$\frac{\partial f}{\partial y}r\cos\theta = \frac{\partial f}{\partial z}r\sin\theta\sin\phi$$
We have
$$\frac{\partial g}{\partial \phi} = -\frac{\partial f}{\partial x}r\sin\theta\sin\phi + \frac{\partial f}{\partial y}r\sin\theta\sin\phi = 0$$
so $g$ in fact does not depend on $\phi$ and we can fix $\phi = \frac\pi2$ so
$$g(r,\theta) = f(0, r\sin\theta, r\cos\theta).$$
We have
$$\frac{\partial g}{\partial \theta} = \frac{\partial f}{\partial y}r\cos\theta - \frac{\partial f}{\partial z}r\sin\theta = 0$$
so $g$ doesn't depend on $\theta$ either. Therefore $g(r,\theta,\phi) = g(r)$ and is differentiable.
Taking $(x,y,z)$ from a dense subset of $\Bbb{R}^3$ we can define $$(r,\theta,\phi) = \left(\sqrt{x^2+y^2+z^2}, \arctan\frac{\sqrt{x^2+y^2}}z, \arctan\frac{y}x\right)$$
and notice
$$f\left(x,y,z\right) = f(r\sin\theta\cos\phi, r\sin\theta\sin\phi, r\cos\theta) = g(r,\theta,\phi) = g(r)= g(\|(x,y,z)\|).$$
By continuity the result extends to all of $\Bbb{R}^3$.
A: Since I prefer a more conceptual approach, note that you can deduce from the two equations that
$$\nabla f(x,y,z) = \lambda(x,y,z)(x,y,z)$$
for some function $\lambda$. Since the gradient of a differentiable function is everywhere orthogonal to the level surfaces of that function, this tells you that the function $f$ is constant on spheres centered at the origin. Thus, $f(x,y,z) = g(\|(x,y,z)\|)$ for some function $g$.
(If you prefer, you can see that the directional derivative is $0$ in any direction tangent to such a sphere, because that directional derivative is given by the dot product of the gradient and the tangent vector, and we all know that $(x,y,z)$ is the normal to the sphere centered at the origin passing through the point $(x,y,z)$.)
