You're question has been answered already, but I want to add that it's not really about not dividing by 0, because by doing that step you implicitly assume that x is not equal to 0, it's about losing information. You shouldn't divide by common factors, which may not just be x on its own, unless you know that it leads to solutions that can be scrapped. For example x(x-2) =(x-2). If you were to divide by x-2, you will get x=1, which is a solution, but you will lose the solution x=2, because the division implies that x is not equal to 2.
If you were to have an equation (x-x1)(x-x2)...(x-x\_n) = 0 then dividing by any product of (x-x\_i), where 1<=i=<n will lose the solutions x=x\_i, because the division assumes that x \\neq x\_i. In fact if you were to divide by all of the factors then you will get 0=0, which is correct which means your steps are correct, but you've extracted no new information.