The square root has more than one solution.
the problem, as other have pointed out, is this step:
-1 actually has TWO square roots, i and -i. unfortunately, there is no way to tell "which is the positive one".
when you write out what this actually means you get:
which is far less controversial.
if one writes out these complex numbers in polar form:
that is, the "proper" square root of 1 to take on the RHS is the negative one, which leads to -1 = -1, which is hardly surprising.
put another way, "angles" aren't uniquely defined by a number, we have to restrict the range of these numbers. this can lead to confusing results, when talking about "half-angles"
(half of 360 degrees is 180 degrees, but half of 0 is 0, and these two angles (0 degrees and 360 degrees) represent "the same direction").