Solution (source code)

= Solution

Work on a domain with $x\ne0$, and suppose $f$ is differentiable at $u=y/x$. The multivariable <chain rule> gives
$$
\frac{\partial w}{\partial x}=f'(u)\frac{\partial u}{\partial x}=-\frac{y}{x^2}f'(u),\qquad\frac{\partial w}{\partial y}=f'(u)\frac{\partial u}{\partial y}=\frac1x f'(u).
$$
Multiplying the first equation by $x$ and the second by $y$ cancels their common terms:
$$
\boxed{x\frac{\partial w}{\partial x}+y\frac{\partial w}{\partial y}=0}.
$$
The geometry is that $y/x$ stays fixed along a radial dilation $(x,y)\mapsto(\lambda x,\lambda y)$. Thus $w$ is constant along each admissible radial ray, and the differential operator $x\partial_x+y\partial_y$ differentiates along that ray. This is the degree-zero case of <Euler homogeneous function theorem>. The displayed quotient does not define a function at $x=0$ without additional extension data.