If solving for an equation one way gives me an undefined answer, does that mean solving it in other ways too will give me an undefined answer? If no, then how consistent is math? (I'm not sure if I'm using the term "consistent" correctly, since I'm aware that it's also used in Gödel's incompleteness theorems which I have very little knowledge about) I also apologize if the way I word my question is confusing.
For example, solving for $a$ in $ab=0$ by the "traditional" way (the way it's taught in elementary and high school) will be like: $$ab=0$$ $$a=\frac 0 b$$
Assuming $b \neq 0$, $$a=\frac{0}{b}=0$$
Hence, $a=0$.
But if $a=b$, then the only number $b$ can be is $0$ or else by the zero product definition, the product of $a$ and $b$ can't be $0$. But this brings a problem because it'll show $b=0$ which contradicts what I assumed and will show that $a=\frac 0 b=\frac 0 0=0$. And $\frac 0 0$ is undefined. But if I try solving for it by taking the square roots of both sides: $$ab=0$$ $$aa=0$$ $$a^2=0$$ $$\sqrt{a^2}=|a|=\sqrt 0$$ $$a=±0=0$$
It gives me an answer (that's not undefined). This confuses me, because I always thought that solving an equation in one way will give me the same and consistent answer as solving the equation in any other way. Maybe I'm getting some concepts wrong from the start which needs to be corrected.
So if solving for an equation gives me an undefined answer, then does that mean I'll need to try to solve for it in another way to see if I can get a defined answer? If so, then how "far" or how many ways should I try until I get the correct answer?