If $x = 0$, then $x/x$ is undefined, right? It's been a while since I worked with math, but I stumbled upon a rather 'simple' equation and the ways of solving it had me thinking for a bit.
Consider this equation:
$$x(1-x) = x(2 - \sqrt{1-x})$$
Any normal person would consider making the problem easier by dividing both left and right side of the equal sign by $x$, but bear in mind that one of the solutions might be $0$, so this is what makes me wonder, why would it be allowed to even divide by $x$ here, if one of its solutions might be $0$ then that is that $0/0$ is undefined... right?
Kindly refresh my memory.
 A: Dividing by $x$ is permissible, but this reduces the equation into two cases where $x$ may or may not be $0$.
Let's go with a basic, almost trivial, example:
$$x^2 + x = x^3 - x^2$$
Now, at a glance, we can divide this by $x$, and get
$$x + 1 = x^2 - x$$
However, the caveats abound:

*

*Yes, if $x=0$, we can't divide by it. We treat this case separately.

*This is especially pertinent since $x=0$ is clearly a solution of the original.

So really we have that
$$x^2 + x = x^3 - x^2 \implies \begin{cases}
x^2 + x = x^3 - x^2, & \text{if } x=0 \text{  (we'll see what happens here)} \\
x+1 = x^2 - x, & \text{if } x \ne 0\end{cases}$$
Well, the second case can be solved as usual via whatever means you prefer, e.g. quadratic formula after rearranging. This will give you some set of solutions (namely, $x = 1 \pm \sqrt{2}$).
The first equation is more simple: if $x=0$, the equation reduces to the true statement $0=0$. We conclude that $x=0$ is a solution. (If it resulted in something false, like $1=0$, then it would not be a solution.)
So the solution set of the original equation is the combination of both solution sets: $0, 1 + \sqrt 2, 1 - \sqrt 2$.

In your case, you divided by $x$.
If $x=0$, then you get something undefined in just $x/x$. BUT if you plug $x=0$ into the original equation you have, you get $0=0$: $0$ is thus a solution.
If $x \ne 0$, it becomes $1$. And then your equation simplifies and you can find some nonzero solutions.
A: You can divide both sides by $x$, but you must bear in mind that you are considering $x\neq 0$. Having said that, you can split the equation's solution into two steps. Firstly, consider $x = 0$ and notice if it is a solution or not (in the present case, it is). Secondly, you can consider that $x\neq 0$ in order to divide both sides by it so that you get the equation $1 - x = 2 - \sqrt{1 - x}$.
Additional Comments
With the purpose to solve such equation, there is no need to divide by $x$. Indeed, you can factor it as:
\begin{align*}
x(1 - x) = x(2 - \sqrt{1 - x}) & \Longleftrightarrow x(1 - x) - x(2 - \sqrt{1 - x}) = 0\\\\
& \Longleftrightarrow x(\sqrt{1 - x} - 1 - x) = 0
\end{align*}
Can you take it from here?
