Simple differential equation $\frac{x}{y}=\frac{y'}{x+1}$ $$\frac{x}{y}=\frac{y'}{x+1}$$ 
The solution to this is very easy, we just multiply both sides by 
$$(x+1)y\ \mathrm dx$$
Then we have 
$$(x^2+x)\ \mathrm dx=y\ \mathrm dy$$
Then we integrate both sides to get solution
$$\frac{x^3}{3}+ \frac{x^2}{2}=\frac{y^2}{2} + C, C\in \mathbb{R}$$
But I don't understand how can we divide by $y$ and $x+1$. What if $y=0$ or $x=-1$? What happens then?

From the form of the DE given at the start it is implied that $x=−1$ and $y=0$ are excluded from the domain and range respectively. If you had an an initial condition this has more impact on your question.
Suppose you had the initial condition that $y\left(\frac{3}{2}\right)=\frac{3}{2}$. This initial condition will result in $c=0$.
So the solution to the DE is $\frac{x^3}{3}+\frac{x^2}{2}=\frac{y^2}{2}$. We must exclude $x=-1$ and $y=0$ from possible solutions.
When $x=-1$ then $\frac{-1}{3}+\frac{1}{2}=\frac{y^2}{2}\implies y=\pm\frac{1}{\sqrt{3}}$.
When $y=0$ then $\frac{x^3}{3}+\frac{x^2}{2}=0\implies x=0,x=-\frac{3}{2}$.
So these values would need to be excluded from your domain/range.
