Let $f :\mathbb R \to \mathbb R$ be a function. Then
Show that $f$ is one one if the graph of $f$ intersects any line parallel to the $X$ - axis in at most one point.
Show that $f$ is onto if the graph of $f$ intersects every line parallel to the $X$ - axis.
My attempt : If I take $f(x) = y = x$ then above statements trivially holds. But this is not a good way and we can't prove any theorem by taking an example.
I don't know how to prove it.
Please help me.
