We have $y' = x/y$, which is a first-order homogeneous differential equation.
It can be solved by rearranging to $y\ dy = x\ dx$ and then integrating both parts which yields that $y = \pm\sqrt{x^2+c}$ .
Now if we use the substitution $y=ux\implies y'=u'x+u,$ and rewrite the differential equation as $$u'x+u=\frac1u$$ and then rearrange to $$\left(\frac{1}{1/u-u}\right)du=\left(\frac1x\right)dx$$ by integrating both parts we get that $$-\frac{1}{2}\ln\left |u^2 -1 \right| = \ln\left |x \right |+c \tag1$$
For $y=\pm x$ (a special solution for $c=0$) $\rightarrow u=\pm1$, and by plugging $\pm1$ into $(1)$ we get that $$\ln\left |0 \right|=\ln\left |x \right| +c \tag2$$
What does equation $(2)$ mean? $\ln\left |0 \right|$ is undefined. Is this of any significance?
Edit 1
As pointed out when rearranging from $u'x+u=\frac1u$ to $\left(\frac{1}{1/u-u}\right)du=\left(\frac1x\right)dx$, we implicitly assumed that $u\neq\pm1$. Equation $(1)$ does not hold for $u=\pm1$.
Edit 2
Solving equation $(1)$ for u with $u\neq\pm1$, we arrive at the same family of equations but with $c\neq0$. The fact that $c$ can be zero comes from setting $u=\pm1$.
When you rearranged your equation to get $$(\frac{1}{1/u-u})du=(1/x)dx$$ you have implicitly assumed that $u \ne \pm 1$ so $u=\pm 1$ is out of question.