I often see in the case of homogeneous differential equations that if $f(x,y)$ is a homogeneous function of order $0$ and, $$\frac{\mathrm{d}y}{\mathrm{d}x}=f(x,y),$$ then the substitution $y=ux$ for some function $u$ TBD, turns it into a separable differential equation, this is easy to prove. However, then they proceed to say $f(x,y)$ must be of the form $g\left(\frac{y}{x}\right)$, for some function $g$ without any proof.
Sure, if $f(x,y)=g\left(\frac{y}{x}\right)$ then of course it is homogeneous of order $0$, but how do we know that this is the only case? I've tried contrapositive proofs, contradictions but none of them seemed to work.