In class the intermediate value theorem was given different to the theorem one usually encounters: https://en.wikipedia.org/wiki/Intermediate_value_theorem.
The Theorem is
$A\subseteq\mathbb{R}$ is connected iff for all $a,b\in\mathbb{R}$ if $a<c<b$, then $c\in A$.
I am not sure about the proof. I think the $\Rightarrow$ implication is proved by contrapositive:
Suppose there is $a,b\in\mathbb{A}$, such that there is some $c$ with $a<c<b$ but $c\notin A$. If we take $(-\infty,c]\cap A$ and $[c,\infty)\cap A$, both intersections are not empty, and the union equals $A$. So $A$ is not connected.
For $\Leftarrow$ I'm not sure how to proceed. I'll appreciate if someone has a solution.