Functions, by definition, can only give one possible y-value for any given x-value. A vertical parabola is an example of a function. A horizontal parabola however is not a function as it has more than one possible y-value for a single x-value.
Your first example may be a function, though I think it is a poor example. Your second one is a true function, which could be written as:
f(x) = (1/2)y
Just check it out, and I hope you got your homework done