Prove using bisection that if $f$ is continuous on $[a, b]$ and $f(a)<0Let's define the following process:
1) If $f(\frac{a+b}{2})=0$, then we're done.
2) If $f(\frac{a+b}{2})\neq0$, then either $f$ changes sign on $[a, \frac{a+b}{2}]$, or on $[\frac{a+b}{2}, b]$. So consider next the interval where $f$ changes sign.  
So we end up with a set of intervals $I_1=[a_1,b_1], I_2=[a_2,b_2],$ etc., with the properties that $a_n \leq a_{n+1}$, $b_{n+1} \leq b_n$, and $\forall a \leq \forall b$.  
Consider the set $A$ of all $a$'s, and the set $B$ of all $b$'s. Clearly, $A\neq\emptyset$ and $B\neq\emptyset$, $A$ is bounded above by any $b$, $B$ is bounded below by any $a$. Hence, there exist $\sup A$ and $\inf B$, $\sup A \leq \inf B$.  
Since intervals $I_n$ are closed, $\sup A \in A$ and $\inf B \in B$. So $[\sup A, \inf B]$ must be the the 'last' interval in the process above.

Question: Can I conclude now that the existence of $\sup A$ and $\inf B$ means that the process above had ended with $f\big(\frac{\sup A + \inf B}{2}\big)=0$?
 A: 
Since intervals $I_n$ are closed, $\sup A\in A$ and $\inf B\in B$. 

That is not true. Consider, for example, the collection
$$I_n = \left[-\dfrac{1}{n}, \dfrac{1}{n}\right].$$
With $A$ and $B$ being as before, it is easy to see that $\sup A = 0 = \inf B$ but $0\notin A$ and $0\notin B$.

Now, let us assume that we get an infinite sequence of the intervals. That is, we never stop at any point. This is possible only if $f\left(\dfrac{a_n+b_n}{2}\right)$ is never $0$ at any stage. (As you pointed out, we are clearly done if we ever do reach a stage where we get a $0$.)  
In this case, your final claim does hold. In fact, we will have $\sup A = \inf B$.  
It is a standard exercise that if you have a sequence $I_1\supset I_2 \supset \cdots$ of nested closed intervals, then their intersection is non-empty.
Moreover, since the size ($b_n - a_n$) tends to $0$, one can also show that the intersection contains precisely one element: Call it $\xi.$
It should be clear that $\sup A = \xi = \inf B$. In particular,
$$\xi = \dfrac{\sup A + \inf B}{2}.$$
Moreover, note has the following properties:


*

*$a_1 \le a_2 \le \cdots \le \xi \le \cdots \le b_2 \le b_1$,

*$f(a_n) < 0 < f(b_n).$
Since $\xi = \sup A$, the first property tells us that $a_n \to \xi$.
Since $f$ is continuous, we have $f(a_n) \to f(\xi)$. From the second property, we conclude that $f(\xi) \le 0$.  
A similar analysis with $(b_n)$ shows us that $f(\xi) \ge 0$. This gives us that
$$f(\xi) = 0,$$
as desired.
A: First notice that the length of $I_n$ halves indefinitely, so at the end the limit interval (intersection) has length $0$. By Nested Interval Theorem it must be non-empty, so the only possibility is that it contains a single point. Then that point must be $\sup A$, and actually $\sup A = \inf B.$ As $a_n \to \sup A$ and $b_n \to \inf B$, we have $f(\sup A) \le 0$ and $f(\inf B) \ge 0$.
A: We will use induction on a descending countable collection $\big\{[a_n, b_n]\big\}_∞^{n=1}$of
closed intervals whose intersection consists of a single point $x_0 ∈ (a, b)$ at which $f(x_0) = c$. Define $a_1 = a$ and $b_1 = b$. Consider the midpoint $m_1$ of $[a_1, b_1]$. If $c < f(m_1)$, define $a_2 = a_1$ and $b_2 = m_1$. If $f(m_1) ≤ c$, define $a_2 = m_1$ and $b_2 = b_1$. Therefore $f(a_2) ≤ c ≤ f(b_2)$ and $b_2 − a_2 =\frac{[b_1 − a_1]}{2}$.Continuing in this way we obtain a descending collection $\big\{[a_n, b_n]\big\}_∞^{n=1}$ of closed intervals such that
$$
f(a_n) ≤ c ≤ f(b_n) ~and ~~b_n − a_n = \frac{[b − a]}{2^{n−1}} ~∀n.
$$
According to the Nested Set Theorem, $\bigcap_{i=1}^\infty\big\{[a_n, b_n]\big\}$ Therefore ${a_n \rightarrow x_0}$.
By the continuity of $f$ at $x_0$, $f(a_n)\rightarrow f(x_0)$. Since $f(a_n) ≤ c$ for all $n$, and the set $(−∞, c]$ is closed, $f(x_0) ≤ c$. By similar argument, $f(x_0) ≥ c$. Hence $f(x_0) = c$
