multiple sets of complex roots of a number? I am not sure if this question was asked before but I couldn't find the right keywords to choose for searching.  
So today I discovered a weird problem:
If we take this equation: $$x^2=1=e^{(0i)}$$
this equation has 2 solutions : $\{1, -1\}$
Until now everything is normal.
but if we wroted like this: $$x^2=x^{\frac{4}{2}}=\sqrt{x^4}=1$$
what happens is that this becomes: $x^4=1^2=1$
and now it has another set of roots: $\{1,-1,i,-i\}$
And we can continue as much as we want getting an infinite number of sets of roots
My question is how is this happening?
Did I make an illegal operation?
Did I miss something?
P.S.: I am not a mathematician, so I could have missed something here (that I probably didn't learn)  
UPDATE
My most important reason for asking is how to deal with equations like this: $$x^{\frac{a}{b}}=c$$ where a and b are 2 integers and you can simplify $\frac{a}{b}$
UPDATE
Obviously i and -i are not solution for $x^2=1$
But if we had from the beginning this equation: $x^\frac{4}{2}=1$ (which is exactly the problem I am waiting for its solution as I mentioned in my previous update above)
we have 2 options simplify to $x^2=1$=>we have only two roots
or do not simplify=>we have four roots and they are all valid: $i^\frac{4}{2}=\sqrt{1^4}=1$ (valid)  
so 2 sets of roots
tl;dr: to simplify or not to simplify? 
 A: Yes, applying $()^2$ to both sides of an equation can alter the set of solutions. It's not necessarily an equivalent transformation:
$$-1=1$$
$$(-1)^2=(1)^2$$
$$1=1$$
In math it's mostly true that $\frac{1}{2} + \frac{1}{2} = 1$ but if you ever cut yourself accidentally you know that two halves of a finger ain't equivalent to a whole one. The used equality is not strict in this regard.
I think removable singularities are another example. Is the function $f(x)$ defined at $x=5$?
$$f(x) = \frac{3x^2-11x +20}{x-5}$$
No. Dividing by 0 is not defined. Wait! What's this?
$$f(x) = \frac{3x^2-11x +20}{x-5}=\frac{(3x+4)(x-5)}{x-5}=3x+4$$
Now it looks like 5 is a very valid value.
You should always be careful when simplifying something. Always check your solutions with the original form to see if they apply for it as well.
A: Certain exponent laws and properties go out the door when you start dealing with complex numbers. That's why you're getting to different solutions when going about this in two different way. 
In general, if $n$ is an integer, then the solution set to the problem $z^n = 1$ is the set of roots
$\{1=e^{2\pi i * (0/n)},e^{2\pi i * (1/n)},e^{2\pi i * (2/n)},\ldots,e^{2\pi i * ((n-1)/n)}\}$
