A one-to-one function must pass both the vertical and horizontal line tests.
The vertical line test shows it’s a function.
The horizontal line test shows it’s one-to-one.
If you look at the graph of this function (the red graph is the function, the green line is the horizontal line test):
it passes the vertical line test (so it’s a function), but it does not pass the horizontal line test.
Therefore it is not one-to-one