Let $f$ be a continuous function such that $f(a)f(b)<0$.Let $a_0=a$ and $b_0=b$ $$x_1:=a_0-\frac{b_0-a_0}{f(b_0)-f(a_0)}f(a_0)$$ If $f(a_0)f(x_1)<0$, set $a_1=a_0$ and $b_1=x_1$
If $f(x_1)f(b_0)<0$, set $a_1=x_1$ and $b_1=b_0$ $$x_2:=a_1-\frac{b_1-a_1}{f(b_1)-f(a_1)}f(a_1)$$ If $f(a_1)f(x_2)<0$, set $a_2=a_1$ and $b_2=x_2$
If $f(x_2)f(b_1)<0$, set $a_2=x_2$ and $b_2=b_1$
having defined $a_1,a_2,...,a_{n-1},b_1,b_2,...,b_{n-1}$ like above $$x_n=a_{n-1}-\frac{b_{n-1}-a_{n-1}}{f(b_{n-1})-f(a_{n-1})}f(a_{n-1})$$
Now $\{x_n \}$ is a sequence $[a,b]$, By Bolzano Weierstrass theorem, there exists a subsequence $\{x_{n_k}\}$ of $\{x_n\}$ which converges to a point $p \in [a,b]$, I want to prove that $f(p)=0$,
If $f(p)<0$, then there exists a $\delta>0$ such that $f(x)<0$ $\forall \in [p-\delta,p+\delta]$
Since $\{x_{n_k} \}$ converges to $p$, there exists $k \in \mathbb{N}$ such that $|x_{n_k}-p|<\delta$ $\forall k \geq K$
$$S_a:=\{k \geq K : x_{n_k}=a_{n_k}\}$$
$$S_b:=\{ k \geq K : x_{b_k}=b_{n_k} \}$$
here, I am stuck, I know that one of the sets defined above is empty but not able to prove it,