naively, one might think:
$x^2 = 4$
therefore:
$(x^2)^{\frac{1}{2}} = 4^{\frac{1}{2}}$
that is:
$x^{(2)\left(\frac{1}{2}\right)} = x = 2$.
and we know that if $x = -2$ we have $x^2 = 4$, so what gives?
in general, the rule:
$(a^b)^c = a^{bc}$
only holds for POSITIVE numbers $a$ (it is a GOOD idea to burn this into your brain). $a = 0$ is a special case, normally it's fine, but problems arise with $0^0$.
while it is true that:
$(k^b)^c = k^{bc}$ for INTEGERS $k$, and INTEGERS $b$ and $c$, things go horribly wrong when we try to define things like:
$(-4)^{\frac{1}{2}}$
and what this means is, when we write:
$x^{\frac{1}{2}} = y$
we are already tacitly assuming $x > 0$.
you can see the graph of $f(x) = \sqrt{x} = x^{\frac{1}{2}}$ here:
y = x^(1/2) - Wolfram|Alpha
the "orange lines" mean that the values of $y$ at $x < 0$ are complex-but-not-real (in fact, they are pure imaginary).
on a deeper level, what is happening is this:
the "squaring function" is not 1-1, it always converts signs to positive (even if we started with a negative). you can think of this as "losing information about where we started from". as a result, we can only "partially recover" our beginnings, by taking a square root (we know the size, but we can only guess at the sign).
the symbol $\pm$ in the answer to $x^2 = 4$ (that is: $x = \pm 2$) is the way we indicate this uncertainty.
however, the function $y = x^{\frac{1}{2}}$ is only defined for $x \geq 0$ (we only get "the top half of the parabola" $y^2 = x$), so at $x = 4$, we have a unique value, namely: 2.
this indicates a peculiarity of functions: they can "shrink" or "collapse" their domains, but they only give ONE output for ONE input, so they cannot always "reverse themselves".