TITLE: Proof of the Intermediate Value Theorem
QUESTION [10 upvotes]: 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$?

REPLY [16 votes]: 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.