When you take the square root, you must take both the positive and negative square roots. The equation

has two real solutions. Thus, because what you actually have for the first equation is

you can see by inspection that it's not a function, since one x value in the domain maps to two different y values.