Proof of the Intermediate Value Theorem Theorem: Let $f$ be continuous on $[a,\,b]$ and assume $f(a)<f(b)$. Then for every $k$ such that $f(a)<k<f(b)$, there exists a $c\in[a,\,b]$ such that $f(c)=k$.

proof: $f$ continuous at $a\implies$ for $\varepsilon=k-f(a)>0$, $\exists\delta>0$ s.t. $$|f(x)-f(a)|<\varepsilon=k-f(a)\quad\forall x\colon |x-a|<\delta.$$ Consider the set $H=\{x\in[a,\,b]\colon f(x)<k\}\not=\emptyset \implies c=\sup{(H)}$. Show $f(c)=k$, suppose $f(c)<k\iff k-f(c)>0$. We know $f$ is continuous at $c$ so $\forall\varepsilon>k-f(c)>0$ $\exists\delta>0:|f(x)-f(c)|<\varepsilon=k-f(c)$ when $|x-c|<\delta$. $\implies f(x)-f(c)<k-f(c)$. Say $x=c+\delta/2\implies f(x)<k\implies c+\delta/2\in H$ which contradicts the fact $c=\sup{(H)}$, since $\delta>0$. Same proof works if $f(c)>k$, thus $f(c)=k$.

This is a proof for the intermediate value theorem given by my lecturer, I was wondering if someone could explain a few things:


*

*What is the set $H$, what does it define?

*Why does contradicting the fact that $c=\sup{(H)}$ prove that $f(c)\not<k$?

*How would I continue to actually finish this proof, ie. show $f(c)\not>k$?

 A: 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.
A: 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.
