I have a question about proof of intermediate value theorem. I will post the entire proof here.
Let $I\subset \Bbb{R}$ be interval $I=(a,b)$, and $f:I\rightarrow\Bbb{R}$ be a continous function. then if some $u$ is between $f(a),f(b)$, then there exists some $c\in (a,b)$ such that $f(c)=u$.
WLOG assume $f(a)<f(b)$. For $f(a)>f(b)$ the proof is very simillar.
Let $S=\{x\in(a,b);f(x)<u\}$. S is non-empty, because $a\in S$ and $S$ is bounded above by $b$. By completeness, $\sup{S}$ exists, call it $c$. We claim, that $f(c)=u$.
Choose some $\epsilon>0$. $f$ is continuous, thus $$f(x)-\epsilon<f(c)<f(x)+\epsilon$$ for all $x\in (c-\delta,c+\delta)$.
By the properties of the supremum, we can chose some $a^*$ from $(c-\delta,c)$ such that $a^*\in S$. We have $$f(c)<f(a^*)+\epsilon\leq u+\epsilon$$
Similarly we can chose $a^{**}$ from $(c,c+\delta)$ such that $a^{**}\notin S$. We have $$f(c)>f(a^{**})-\epsilon\geq u-\epsilon$$
which together gives $$u-\epsilon<f(c)<u+\epsilon$$ which holds for all $\epsilon >0$, thus $f(c)=u$ is the only possible value, as claimed.
My question is: Why can't we conclude the proof after saying that the supremum exist? I don't understand in which sense we used the fact that $f$ is continuous. As I know, if we don't use all assumptions in a proof, it is somehow wrong. Would anyone please explain me, what could happen if $f$ wasn't continuous? Why can't we say directly from definition of $S$ that $\sup{S}=u=f(c)$, I must be missing something.