Understanding Bolzano-Weierstrass theorem I came across the following version of Bolzano-Weierstrass theorem: 

Let a function $f:[a,b]\rightarrow \Bbb R$ be continuous on the
  segment $[a,b]\subseteq \Bbb R$. Then $f([a,b])=[m,M]$ is also a
  segment.

Can someone explain what this means(preferably with an example)? Why is this theorem important?
 A: There are three crucial steps:
1) Bolzano-Weierstrass Theorem stating that

Every bounded sequence of real numbers 
  has a convergent subsequence.

The method of the proof sometimes is jokingly
referred to as "how to catch the lion in the
Sahara desert".
2) Next, is the First Weierstrass theorem stating that

Every function $f$ which is continuous on a (finite)
  closed interval $[a,b]$ of $\mathbf R$ is bounded. 

The standard proof is towards a contradiction: suppose
that there is a sequence $(x_n)$ of points of $[a,b]$
such that
$$
|f(x_n)| \to +\infty. 
$$
Then we shall quickly obtain a contradiction if we apply
the Bolzano--Weierstrass theorem (think how it may be done).
3) Finally, the Second Weierstrass theorem a.k.a. the
Extreme Value Theorem stating that

Every function $f$ which is continuous on a (finite)
  closed interval $[a,b]$ of $\mathbf R$ attains in
  this interval its minimum and its maximum value. 

To decipher, there are $x_0,x_1 \in [a,b]$ such that 
$$
m=f(x_0) \le f(x) \le f(x_1)=M
$$
for all $x \in [a,b]$ (in particular, the image of $[a,b]$
under $f$ is $[m,M]$).  Naturally, we apply the First Weierstrass theorem. 
Studying examples to understand the Second Weierstrass Theorem would be of a little help; concepts and proofs matter more. 
A: This is not exactly Bolzano Weierstrass theorem. Bolzano Weierstrass theorem has two forms:


*

*Any infinite bounded subset of real numbers has an accumulation point. 

*Any bounded sequence has a convergent subsequence. 


You can see that both these forms of Bolzano Weierstrass are equivalent. The theorem mentioned in question combines three famous properties of continuous functions on a closed interval. These are what Michael Spivak calls Three Hard Theorems in his book Calculus. Needless to say these theorems are of theoretical nature and are easy consequences of the completeness property of real numbers. Spivak calls them hard only because these are not proved in most calculus textbooks. These I state below:


*

*If $f$ is continuous on $[a, b] $ then $f$ is bounded on $[a, b] $.

*If $f$ is continuous on $[a, b] $ then it attains its supremum and infimum.

*If $f$ is continuous on $[a, b] $ with $f(a) \neq f(b) $ and $k$ is some number between $f(a) $ and $f(b) $ then $f$ attains the value $k$ somewhere in $(a, b) $. This is more popularly known as the Intermediate Value Theorem for continuous functions.


Combining these three properties we can easily see that the range of a function $f$ continuous on $[a, b] $ is also a closed interval (first two properties ensure that there is a minimum and a maximum value of $f$ and the third one ensures that $f$ takes all the values between these two extreme values). 
