===================================================
Explanation:
It is a function because it passes the vertical line test. We cannot draw a single vertical line through more than one point on the red curve. Any x input leads to exactly one and only one y output.
A similar test is the horizontal line test. We cannot draw a single horizontal line through more than one point on the red curve, so this red curve passes the horizontal line test. Each y is only paired with one x value only. This helps set up an inverse function.
-----------
In short:
If the curve passes the vertical line test, then we have a function
If the curve passes the horizontal line test, then it is one-to-one.