Suppose \(f(x)\) is continuous on \([a,b]\) and \(v\) is any real number between \(f(a)\) and \(f(b)\text{.}\) Then there exists a real number \(c\in[\,a,b]\) such that \(f(c)=v\text{.}\)
We will look at the case \(f(a)\leq v\leq f(b)\text{.}\) Let \(x_1=a\) and \(y_1=b\text{,}\) so we have \(x_1\leq y_1\) and \(f(x_1)\leq v\leq f(y_1)\text{.}\) Let \(\,m_1\) be the midpoint of \([\,x_1,y_1]\) and notice that we have either \(f(m_1)\leq v\) or \(f(m_1)\geq v\text{.}\) If \(f(m_1)\leq
v\) , then we relabel \(x_2=m_1\) and \(y_2=y_1\text{.}\) If \(f(m_1)\geq v\) , then we relabel \(x_2=x_1\) and \(y_2=m_1\text{.}\) In either case, we end up with \(x_1\leq
x_2\leq y_2\leq y_1\text{,}\)\(y_2-x_2=\frac{1}{2}\left(y_1-x_1\right)\text{,}\)\(f(x_1)\leq
v\leq f(y_1)\text{,}\) and \(f(x_2)\leq v\leq f(y_2)\text{.}\)
Now play the same game with the interval \([\,x_2,y_2]\text{.}\) If we keep playing this game, we will generate two sequences \(\left(x_n\right)\) and \(\left(y_n\right)\text{,}\) satisfying all of the conditions of the nested interval property. These sequences will also satisfy the following extra property: \(\forall\)\(n,\,f(x_n)\leq v\leq
f(y_n)\text{.}\) By the NIP, there exists a \(c\) such that \(\,x_n\leq c\leq y_n\text{,}\)\(\forall\)\(n\text{.}\) This should be the \(c\) that we seek though this is not obvious. Specifically, we need to show that \(f(c)=v\text{.}\) This should be where the continuity of \(f\) at \(c\) and the extra property on \(\left(x_n\right)\)and \(\left(y_n\right)\) come into play.
We can modify the proof of the case \(f(a)\leq v\leq
f(b)\) into a proof of the IVT for the case \(f(a)\geq
v\geq f(b)\text{.}\) However, there is a sneakier way to prove this case by applying the IVT to the function \(-f\text{.}\) Do this to prove the IVT for the case \(f(a)\geq v\geq
f(b)\text{.}\)