In the proof of Intermediate Value Theorem, we first consider the case $f(a)>c$ and $f(b)<c$, and then define the set $S = \{x \in [a,b] : f(x)\geq c\}$, and then consider $\sup S=t$ and then show that $f(t)=c$ (the diagram makes it obvious.)
However in the proof they also consider cases $f(t)<c$. But as $t$ is in $S$, $f(t)\geq c$ by definition, so why do we consider that case? If the supremum is not in the set, then too, after all we show that $f(t+\frac{\epsilon}{2})<0$ so that $t+\frac{\epsilon}{2}$ is an upper bound for $S$, but how's that happening? We did not define the set $S$ in such a way right? What mistake am i making? Thanks for helping.