# Proof that X is connected if every continuous function on X has a fixed point

Just came from an exam and I am wondering how to prove the following:

A topological space $X$ is connected if for each continuous function $f:X\rightarrow X$ there is a $x \in X$ such that $f(x)=x$.

Let us show that the contrapositive holds. If $X$ is not connected, then $X=U\cup V$ for some disjoint open non-empty subsets $U$ and $V$. Pick $u$ in $U$ and $v$ in $V$. Can you think of a continuous function $f:X\to X$ using $u$ and $v$ and such that $f(x)\ne x$ for every $x$ in $X$?
One way to ensure this condition would be that $f(x)\in V$ for every $x$ in $U$ and that $f(x)\in U$ for every $x$ in $V$. But remember, $f$ must be continuous... Last hint: one can do this with $f(X)=\{u,v\}$.
Exercise: Find some connected $X$ and some continuous $f:X\to X$ with no fixed point (thus the reverse implication does not hold).
• Of course non-empty $U, V$. – Jeppe Stig Nielsen Aug 6 '14 at 10:09
• Exercise no. 2: (harder) Show that the fixed-point property that is the hypothesis of the problem, is satisfied for some space $X$ with more than one point in it. – Jeppe Stig Nielsen Aug 6 '14 at 10:16