Theorem:
Let $f: [a,b] \to \mathbb{R}$ be continuous and let $f(a)<d<f(b)$, then $ \exists c \in [a,b] $ such that $ f(c)=d$.
Proof:
Consider the set $H=\{x∈[a,b]:f(x)<d\}≠∅$, since $H$ is bounded, it has supremum $c\in [a,b]$. There are three cases:
$f(c)=d$
$f(c)<d$
$f(c)>d$
For case 1 we are done, and the theorem holds.
For the second case: Suppose $f(c)<d$. In partricular $c\in H$ and, moreover $a<c<b$, because by asssumption $f(a)<d$ and $f(b)>d$. By continuity of $f$ at $c$, there's $\delta >0$ such that $a<c-\delta <c+\delta <b$ and $|x-c|<\delta \implies f(x)<d$ (by considering the continuous function $d-f(x)$ wchich is positive at c). Bbut then $c+ \frac{\delta}{2} \in H$, becasue $f(c+ \frac{\delta}{2})<d$. A contradiction to the fact that $c=supH$.
For the third case: Suppose $f(c)>d$. By continuity of $f$ at $c$, there's $\delta >0$ such that $a<c-\delta <c+\delta <b$ and $|x-c|<\delta \implies f(x)>d$. But by definition of supremum, there is $x\in H$ such that $c-x<\delta$; for this $x$ we have both $f(x)<d$ and $f(x)>d$, a contradiction. Therefore we conclude that $f(c)=d$.
Is this proof valid?