It seems that $\sqrt{ab}=\sqrt{a}\sqrt{b}$ is only defined for $a,b\geq 0$, because it doesn't work for $a,b<0$.
I can see that it doesn't work. I would like to know why it doesn't work. Is there a less circular reason than "by definition"?
This comes up in Khan Academy's i as the principal root of -1 and wikipedia's square root faulty proof:
$$ \begin{align*} -1&=ii\\ &=\sqrt{-1}\sqrt{-1}\\ &=\sqrt{(-1)(-1)}\\ &=\sqrt{1}\\ &=1 \end{align*} $$
They say $ii=\sqrt{-1}\sqrt{-1}$ is OK, and the faulty step is $\sqrt{-1}\sqrt{-1 }=\sqrt{(-1)(-1)}$, because $\sqrt{ab}=\sqrt{a}\sqrt{b}$ is only defined for $a,b\geq 0$.
Since $(\sqrt{a}\sqrt{b})^2=ab$, $\sqrt{a}\sqrt{b}=\pm\sqrt{ab}$. The only way to get rid of the $\pm$ sign for a more specific conclusion is by comparing the two sides of the equation. For $a,\,b\ge 0$, square roots are non-negative do we're fine. With negative numbers, the two $i$ factors on the LHS ruin it. If you want a fancier explanation than that, no inverse of $z^2$ on $\mathbb{C}$ is continuous, as can be seen by considering its phase.