In this blog post, RJ. Lipton mentions an example of common mathematical traps. In particular, that ``square root is not a function''. He shows the following trap:
Start with: $\frac{-1}{1}=\frac{1}{-1}$, then take the square root of both sides: $$ \frac{\sqrt{-1}}{\sqrt{1}}=\frac{\sqrt{1}}{\sqrt{-1}} $$ hence $$ \frac{i}{1} = \frac{1}{i} \\ i^2=1 \enspace , $$ which contradicts the definition that $i^2=-1$.
Question 1: I know that the square root is not a function because it is multi-valued, but I still can not wrap my head around this example. Where was the problem exactly? Was is that we
- can not convert $\sqrt{1/-1}$ to $\sqrt{1}/\sqrt{-1}$?
- both the RHS and LHS are unordered sets?
- both?
Question 2: Also, does this problem only arise in equalities or in general algebraic manipulation? Because it would be a nightmare when manipulating an expression with fractional powers! Are there easy rules to determine what is safe to do with fractional powers? To see what I mean, there is another example of a similar trap:
One might easily think that $\sqrt[4]{16x^2y^7}$ is equivalent to $2x^{1/2}y^{7/4}$, which is not true for $x=-1$ and $y=1$.
Without going into complex analysis, I think this is the simplest way I can explain this. Let $f(x) = \sqrt{x}$. Note that the (maximal) domain of $f$ is the set of all non-negative numbers. And how is this defined? $f(x) = \sqrt{x}$ is equal to a non-negative number $y$ such that $y^2=x$. In this sense, square root is a function! It is called the principal square root.
In contrast, the following correspondence is not a function: the relation $g$ takes in a value $x$ and returns a value $y$ such that $y^2=x$. For example, under $g$, 1 corresponds to two values, $1,-1$.
Now, the property of distributing a square root over a product is only proven (at least in precalculus) over the domain of the principal square root, that is, only for non-negative numbers. Given this, there is no basis for the step
$$\frac{\sqrt{1}}{\sqrt{-1}} = \frac{\sqrt{-1}}{\sqrt{1}}.$$
As to why this property is not true, the best explanation for now is that because $-1$ is not in the domain of the principal square root. Hence, $\sqrt{-1}$ does not actually make sense, as far as our definition of square root is concerned. In complex analysis, more can be said. As a commenter mentioned, this has something to do with branches of logarithms.
For your second question, I think it is safe that you always keep in mind what the domain of the function is. If you will get a negative number inside an even root, then you can't distribute the even root over products or quotients.