Prove $f:[a,b]\to [a,b]$ is a homeomorphism, then $a$ and $b$ are fixed points or $f(a)=b$ & $f(b)=a$ 
Prove $f:[a,b]\to [a,b]$ is a homeomorphism, then $a$ and $b$ are fixed points or $f(a)=b$ & $f(b)=a$

Hello. I've been struggling with this question. I found something related:

*

*Continuous involutions on $\mathbb R$ with at least two fixed points. However, I am not sure how to apply it.

I know a homeomorphism is equivalent to (1) Bijection (2) $f$ continuous (3) $f$ inverse continuous.  I am not sure how these conditions are related to prove the function has 2 fixed points or $f(a)=b$ and $f(b)=a$.
This is a question from my introduction to real analysis course. The only theorems proved are: (1) Brouwer fixed-point theorem (case $n$=1). (2) Banach theorem.
I’d really appreciate some help. Thanks in advance.
 A: If you know a little topology: If $f(a)$ is not in $\{a,b\}$, the map $$(a,b] \to [a,b] \setminus \{f(a)\}; \quad x \mapsto f(x)$$ is a homeomorphism between a connected space and a disconnected space. Thus $f(a) \in \{a,b\}$, and similarly $f(b) \in \{a,b\}$.
A: Use Continuous injective map is strictly monotonic to prove that $f$ is strictly monotonic. Coupled with the IVP of continuous functions, the conclusion easily follows:
If $f$ is increasing then:
$$f([a,b])=[f(a),f(b)]=[a,b]$$
and if $f$ is decreasing then:
$$f([a,b])=[f(b),f(a)]=[a,b]$$
A: Momo's answer is complete; I'm just including my version which doesn't directly use monotonicity. If $f(a)<f(b)$, then we claim $f([a,b])=[f(a),f(b)]$. If $f(a)\le y\le f(b)$, then the intermediate value theorem gives $x\in [a,b]$ such that $f(x)=y$. Since $f$ is injective, $f^{-1}(\{y\})=\{x\}$. This implies $f^{-1}([f(a),f(b)])\subseteq[a,b]$. The same exact argument applied to the inverse function shows
$$(f^{-1})^{-1}([f^{-1}(f(a)),f^{-1}(f(b))])\subseteq [f(a),f(b)],$$
so the image of $f$ is exactly $[f(a),f(b)]$.
Now if $f(a)>a$, then $a$ is not in the image of $f$. If $f(b)<b$ we get a similar contradiction.
A similar argument works when $f(b)<f(a)$.
A: If $a<b$ then the only $x$ in the space $[a,b]$ that has a local base $B_x$ such that
$\partial c$ has exactly one member for every $c\in B_x$
are $x=a$ and $x=b.$
Therefore $\{a,b\}=\{f(a),f(b)\}.$
This is because the order-topology on $[a,b]$ is connected.
