Hello!
If x represents the domain while y represents the range, this is not a function. Each input can have only one output. Outputs can have multiple inputs, but not the other way around.
As you can see, -1 goes to both 2 and -1, so it is not a function.
I hope this helps!