The square root and other non-integer exponents can be defined using the complex logarithm, which is defined as the multivalued "inverse" of the complex exponential. Why multivalued? Note that we have
e^z=e^{z+i2\pi n}
for any integer n. What's \log e^z supposed to be? z? It can't be, since that would imply that
z=\log e^z=\log e^{z+i2\pi n}=z+i2\pi n
for all n, which implies that all integers are zero.
We can avoid this problem by defining
\log z=\log(|z|e^{i Arg\ z})=\log |z|+i Arg\ z+i2\pi n
The right-hand side should actually be interpreted as the set
\{\log |z|+i Arg\ z+i2\pi n|n\in\mathbb Z\}
but it's too awkward to always use that notation. Note that when we take the logarithm of both sides of the first equation in this post, we get the same thing on both sides, so we have at least solved that problem.
Now we can define z^a by
z^a=e^{\log z^a}=e^{a\log z}.
The square root is the special case a=1/2.
\sqrt z=e^{\frac 1 2 \log z}=e^{\frac 1 2(\log |z|+i Arg\ z+i2\pi n)}=\pm\sqrt{|z|}e^{\frac i 2 Arg\ z}
So with this definition we get \sqrt{-1}=\pm i. If we instead choose to define \sqrt z as the single value \sqrt{|z|}e^{\frac i 2 Arg\ z}, we get \sqrt{-1}=i.