An example where this is true would be ( i think this is right - other mathematicians are welcome to check)
$$\\examples\\
x=\sqrt y\\
y=x^3\\
y=-x(3-x)^2$$

https://www.desmos.com/calculator/upcp0cts6b
Notice that all the positive y values have a unique x value.
So the top half of the graph passes the horizontal line test.