TITLE: Proof of Intermediate Value theorem which I dont understand
QUESTION [5 upvotes]: Intermediate Value Theorem. Let $f : [a, b] → R$ be continuous
and suppose that $u$ lies between $f(a)$ and $f(b)$. Then there is
a point $c$ between $a$ and $b$ where $f(c) = u$.
Proof part 1: 
*Assume that $f(a) < u < f(b)$ and let $A$ be the set
$\{x \in [a, b] : f(x) ≤ u\}.$
This set is non-empty since it contains $a$ and is bounded above by $b.$
Let $s$ be its least upper bound.
The aim is to show that $f(s) = u$.
*
Why are we trying to show $f(s)=u$? I understand that the value $u$ needs to have some value $c$ assigned to it between $a$ and $b$ but why does the supremum $s$ matter here. I have looked at the whole proof by the way but to start with I don't understand this. Also what does $f(x)≤u$ mean here I don't understand the use of it.

REPLY [2 votes]: The informal thinking behind this proof is roughly the following:
Think of the graph of the function $y=f(x)$. Now draw a line at height $y=u$. Try to visualize the set $A:=\{x \in [a,b]:f(x) \leq u\}$. This consists of all $x$ for which the graph is below or at the level of this line.
The idea now is to consider what happens at the boundary (just in a naive sense, not necessarily topologically) of this set $A$. There we switch from being in the set $A$ to not being in the set $A$. Or in other words from being below the line to being above the line. Since we have a continuous function this means, we need to be on the line, so there $f(x) = u$.
Now how to find a point on this boundary? This is simple, we take the rightmost point of $A$, which is the least upper bound $s:= \sup A$. Then to the left of $s$, we are in $A$ and to the right we are not in $A$. So we are on the boundary, as desired.
From this idea it is not hard to write down the details of the formal proof.