I am a little bit bummed that I have this question as I'm sure it has been asked before (I couldn't find the answer) but...
If $\sqrt{a}\sqrt{b} = \sqrt{ab}$ is only true for positive reals $a$ and $b$. Then what allows us to say the following? $$\sqrt{-a} = \sqrt{-1\cdot a} = \sqrt{-1}\sqrt{a} = i\sqrt{a}$$
I don't know what allows the second equal sign. Is this just convention?
The square root function is usually understood by convention to return the "principal" square root of a complex number. For real numbers, this just means that the square root of a positive real is a positive real and the square root of a negative real is imaginary with positive imaginary part. Under this convention, it happens to be valid that $\sqrt{ab}=\sqrt{a}\sqrt{b}$ if $a$ and $b$ are real with at least one of them nonnegative. But the equality fails if both are negative. For example $$ 1=\sqrt{(-1)(-1)}\neq\sqrt{-1}\sqrt{-1}=i\cdot i=-1. $$