Location of roots using Darboux property I was studying the Bisection method for root finding. It states that for a continuous function we can find out a root if it exists by the Intermediate value theorem.My question is why do we need Continuity of a function? Can't I just work with a function having just the intermediate value property without being continuous?
 A: For the sake of completeness, we mention that a function is Darboux on an interval $I$ if it has the intermediate value property. That is, for any $a,b\in I$ with $a<b$ and for any $y$ between $f(a)$ and $f(b)$, there is a $c$ between $a$ and $b$ such that $y=f(c)$.
Continuous function are Darboux by the intermediate value theorem but there are discontinuous functions that are Darboux as well. One example is
$$
f(x) = \begin{cases}
  \cos\left(\frac{2\pi}{x}\right) & x > 0 \\
  -\cos\left(\frac{2\pi}{x}\right) & x < 0 \\
  1 & x = 0.
\end{cases}
$$
whose graph looks like so:

I think it's pretty easy to see that $f$ is Darboux. Also note that
$$f\left(\pm \frac{1}{k}\right) = \pm 1$$
for all $k\in\mathbb N$.
Now, ff we apply the bisection method over the interval $[-1,1]$, we generate the following sequence of nested intervals:
$$
\begin{aligned}
I_0 & = [-1,1], \\
I_1 & = [-1,0], \\
I_2 & = \left[-\frac{1}{2},0\right], \: \: (\text{since } f(0) = 1) \\
\vdots & = \: \: \: \: \vdots \\
I_n & = \left[\frac{1}{2^{n-1}},0\right].
\end{aligned}
$$
We can now see the problem pretty clearly. The bisection method will generate a nested sequence of intervals collapsing down to a point (zero in, this case) but, without continuity, that point need not be a root of the function.
