I am sure that this has been discussed many times and the answer may be trivial. But I was confronted with the following issue and could not give a satisfactory answer: $$1=(-1^{6})^{\frac{1}{2}}=-1^{6\cdot\frac{1}{2}} = -1^{\frac{1}{2}\cdot 6}=(-1^{\frac{1}{2}})^6 = (\sqrt{-1})^6.$$
On the left handside of the chain, we have $1$, and on the right handside, we have the square root of a negative number, which is not defined with real numbers. Also moving towards complex numbers does not seem to help, as $$(\sqrt{-1})^6 = (\sqrt{i^2})^6 = i^6 = (i^2)^3 = (-1)^3 = -1.$$ Where is the mistake or the step that is not allowed?