Find smallest and largest values in a bounded interval such that a function equals a value I have the following problem: If $v$ is a value of a continuous function $f:[a,b] \rightarrow \mathbb{R}$, use the least upper bound property to prove that there are smallest and largest $x \in [a,b]$ such that $f(x) = v$.
By virtue of the property I know that there exists a least upper bound for $[a,b]$. I guess my issue with this problem is that I don't see how that fact applies. Is it just that I know that there are smallest and largest values in the interval, so therefore for all of the $x \in [a,b]$ that satisfy the condition $f(x) = v$, there has to be smallest and and largest values?
 A: An advanced idea ould be: As $f$ is continuous and singleton sets are closed, the set $V:=\{\,x\in[a,b]:f(x)=v\,\}$ is closed.
However, we can treat the problem directly with basic properties such as the least upper bound: We are given that $V\ne\emptyset$ and hence have $a\le \sup V\le b$.
If $\sup V=a$ we are done as then necessarily $V=\{a\}$.
So we may assume that $\sup V>a$.
Assume $f(\sup V)\ne v$. Let $\epsilon=\frac12|f(\sup V)-v|>0$. Then there exists $\delta>0$ such that for all $x\in[a,b]$ with $|x-\sup V|<\delta$ we have $|f(x)-f(\sup V)|<\epsilon$. Especially, we have $f(x)\ne v$ for such $x$, contradicting the fact that $x\in V$ for all $x<\sup V$ with $|x-\sup V$ small enough. We conclude that $f(\sup V)=v$. As $x\notin V$ for all $x>\sup V$, we find that indeed $\max V=\sup V$.
A: Note that $s = \sup\{x \in [a,b]: f(x) = v\}$ is finite since the set is bounded.  
Show using continuity that $f(s)= v$.  If $f(s) > v$, then $f(x) > v$ for all $x \in (s- \delta,s)$. Hence, $s - \delta/2$ is an upper bound for $\{x \in [a,b]: f(x) = v\}$, a contradiction. Similarly, if $f(s) < v$, then $f(x) < v$ for all $x \in (s- \delta,s)$ -  also a contradiction.
