Can someone prove why $\sqrt{ab}=\sqrt{a}\sqrt{b}$ is only valid when a and b are positive? I have seen many people say that a and b can't be positive for example in this false proof : 
$$1=\sqrt{1}=\sqrt{(-1)(-1)}=\sqrt{-1} \sqrt{-1} = i^2 = -1$$
Trust me, I understand that $1\neq -1$ and also by seeing this, I believe and accept that a and b should be positive or greater than 0 (for  $\sqrt{ab}=\sqrt{a}\sqrt{b}$) 
But I'm interested to know why is that, which is something I don't know? What is the proof ? 
Thanks a lot. 
 A: If $a$ is a complex number and you write $\sqrt{a}$ to denote a specific number, you have introduced a problem, as there are two complex numbeers whose square is $a$.
The problem shows up when you need to choose one of the two alternatives for all complex numbers at the same time, and this is unavoidable in some situations. For example, notice that for a statement such as

for all complex numbers $a$ and $b$ we have $\sqrt a\sqrt b=\sqrt{ab}$

to mean anything, we need to give sense to $\sqrt{a}$ for all $a$s.
A good choice for $\sqrt{-1}$ is certainly $i$. A good choice for $\sqrt{1}$ is $1$, of course. Now $\sqrt{-1}\cdot\sqrt{-1}$ is, according to these choices, equal to $i\cdot i$ which is $-1$. On the other hand $\sqrt{(-1)(-1)}$ is $\sqrt{1}$ and we chose that to be $1$; we have a problem.
Ok. Maybe we should have chosen $\sqrt{1}$ to be $-1$? Let's see what happens. Now $\sqrt{1}\cdot\sqrt{1}$ is $(-1)\cdot(-1)$, which is $1$, and $\sqrt{1\cdot1}=\sqrt{1}=-1$: oh no!
And you can go on like this...
Indeed, theere are four choices in all for what $\sqrt{1}$ and $\sqrt{-1}$ can mean:
| sqrt{1} sqrt{-1}
|   1       i      
|   1      -i     
|  -1       i     
|  -1      -i

In each of these four options you can reach a problem.
A: $\sqrt{x}$ is defined in $\mathbb{R}$ as long as $x \geq 0$. Thus in the first place for $\sqrt{ab}$ to be defined and make sense in $\mathbb{R}$ we would need $ab \geq 0.$ When $ab=0,$ the case is trivial. So let's consider the case when $ab>0$ which yeilds either $a>0,b>0$ or $a<0,b<0$. In the first case, both $\sqrt{a}$ and $\sqrt{b}$ are well defined and hence $\sqrt{ab}=\sqrt{a}\sqrt{b}$ is true. However, in the second case, as both $a$ and $b$ are negative, neither of $\sqrt{a}$ and $\sqrt{b}$ are defined. Thus we cannot write $\sqrt{ab}=\sqrt{a}\sqrt{b}$ when $a$ and $b$ are negative.   
As far as complex numbers are concerned, your question does not apply since complex numbers are not ordered in the usual sense. I mean, you cannot talk of a complex number being positive or negative. For example, if $i$ were positive, then $i^2 \geq 0$ which is not true as $-1 \ngeq 0$ and also if $i$ were negative, then again we get $i^2 \geq 0$ which is not true as $-1 \ngeq 0$.
