This is the Intermediate Value Theorem as stated and proved in Munkres: Topology A First Course
I understand everything except the claim that $(-\infty, r) \subset Y$ and $(r, +\infty) \subset Y$, I don't see why $-\infty, \infty \in Y$, since all we know about $Y$ is that it is an ordered set, we don't know anything about the structure or the elements of $Y$.
