You can only cancel the $y+xy'$ terms if that is not equal to zero, otherwise you're dividing by zero. Assuming that is not equal to zero gets you
$$
\frac{1}{1+xy} = 1
$$
so
$1+xy=1$, or $xy=0$, which gives you $\log 1=0$ in the original equation. So the solution is based on the notion that for the equation to be non-trivial, $y+xy'=0$.
Incidentally, based on the hint in abel's post, I tried solving the differential equation, and I got
$$
{dy \over y} = -{dx \over x}
$$
which yields
$$
\ln y = -\ln x + c \Rightarrow y=k/x.
$$
But, as abel states, the only real solution for the original equation is $k=0$. Wolfram alpha gives a useful graph.