It is a function because all the inputs (x values) have one output (y value).
For something to be a function, inputs can only have ONE output, if an input has multiple outputs, it is not a function.
If different inputs have the same output, it is still a function because they don't have the same input value