In topology class, continuous and surjective problem Let $f:[0.1]\to [a,b]$ be a continuous function such that $f(0)=a$ and $f(1)=b$. Prove that $f$ is surjective.
I don't know how to start this problem. Any hint or comment is welcome.
 A: I'd use the following theorem (from general topology):
Continuous functions $f: \mathbb R \to \mathbb R$ map connected sets to connected sets. 
To prove that $f: [0,1]\to [a,b]$ is surjective you might argue by contradiction: Assume there was $y \in [a,b]$ such that $y \notin f([0,1])$. Then $U = (-\infty, y)\cap f([0,1])$ and $V= (y,\infty) \cap f([0,1])$ are two open sets in $f([0,1])$ such that $U \cap V = \varnothing$ and $U \cup V = f([0,1])$. This would mean that $f([0,1])$ is not connected, a contradiction. 
A: Suppose $f$ is not surjective . Then there exists atleast a $x \in (a,b) $ which doesn't have a preimage in $(0,1)$ i.e there doesn't exist any $y \in (0,1) $ such that $f(y)=x$. But this would contradict the Intermediate value theorem which says that for any $x \in (a,b)$, there must exist a $y \in (0,1)$ such that $f(y) =x$.  
Note: Intermediate value theorem holds good because $f$ is continuos
A: I don't know, why everyone here wants to argue by contradiction? I personally don't like this. 
So just say: f is surjective, since every point $x \in [a,b]$ is hit by the intermediate value theorem.
That's it.
(if you don't want to use analysis on this one you maybe need two sentences.)
