Proof of the Intermediate Value Theorem
The set $H$ is the set of elements $x\in [a,b]$ for which $f(x)<k$.
Since this set is bounded, it has a supremum $c\in[a,b]$. There are three cases:
- $f(c)=k$
- $f(c)<k$
- $f(c)>k$
In the first case, you're done.
Suppose $f(c)<k$. In particular $c\in H$ and, moreover $a<c<b$, because by assumption, $f(a)<k$ and $f(b)>k$. By continuity of $f$ at $c$, there is $\delta>0$ such that $a<c-\delta<c+\delta<b$ and $$ |x-c|<\delta \implies f(x)<k $$ (by considering the continuous function $k-f(x)$ which is positive at $c$). But then $c+\delta/2\in H$, because $f(c+\delta/2)<k$. A contradiction to the fact that $c=\sup H$.
Suppose $f(c)>k$. By the same argument as before, there exists $\delta>0$ such that $a<c-\delta<c+\delta<b$ and $$ |x-c|<\delta \implies f(x)>k $$ But, by definition of supremum, there is $x\in H$ such that $c-x<\delta$; for this $x$ we have both $f(x)<k$ and $f(x)>k$, a contradiction.
Ideas for a possibly clearer, easier proof:
1) Prove that if $\;f\;$ is continuous at $\;[a,b]\;$ and $\;f(a)f(b)<0\;$ then there exists $\;c\in (a,b)\;\;s.t.\;\;f(c)=0\;$
2) prove the complete IVT by choosing $\;g(x):=f(x)-k\;$ and applying (1) to $\;g\;$ .
Highlights of proof of (1) : WLOG assume $\;f(a)<0\;,\;\;f(b)>0\;$ . Take the point $\;w_1:=\frac{a+b}2\;$ . If $\;f(w_1)=0\;$ we're done, otherwise choose the interval
$$\begin{cases}\left[\,a\,,\,w_1:=\frac{a+b}2\,\right]&,\;\;\text{if}\;\;f(w_1)>0\\{}\\or\\{}\\ \left[\,w_1:=\frac{a+b}2\,,\,b\,\right]&,\;\;\text{if}\;\;f(w_1)<0\end{cases}$$
Take now $\;w_2=\frac{a+w_1}2\;\;or\;\;w_2=\frac{w_1+b}2\;$ , depending on what interval we chose above, resp. If $\;f(w_2)=0\;$ we're done, otherwise do as above.
Continue the process above inductively
Apply now Cantor's Theorem (of embedded closed interval which lengths tend to zero) to deduce there's one single point $\;c\;$ in the intersection all these interval, use continuity of $\;f\;$ to show that $\;f(\text{left endpoints of intervals})\to f(c)\;$ , and likewise for right end points, and by construction get
$$0\le f(c)\le 0\implies f(c)=0$$
Fill in details.