A topological space $(X, \tau) $ is called a fixed point space iff $ f\in C(X, X) $ implies $\textrm{Fix}_f(X) \neq \emptyset$
Theorem: $(X, \tau) $ FPS implies $(X, \tau) $ connected.
Proof: Suppose $(X, \tau) $ is not connected. Then $X=A\cup B$ where $A, B\in\tau\setminus\{\emptyset\}$ and $A\cap B=\emptyset$
Fix $a\in A$ and $b\in B$ and consider $f:X\to X$ such that $$f(x) =\begin{cases}a&x\in B\\ b&x\in A\end{cases}$$
CLAIM:
$f\in C(X, X) $
$\textrm{Fix}_f(X) =\emptyset$
SKETCH OF THE PROOF:
- Let $U\in\tau$.
$f^{-1}(U) =\begin{cases}\emptyset & a, b\not\in U\\ B& a\in U, b\not \in U\\ A&b\in U, a\not\in U\\ X&\{a, b\}\subset U \end{cases}$
- $f(x)\in A \iff x\in B$ and $A\cap B=\emptyset$
Example:
$([a, b], \tau_{\text{euclidean}}) $ is a fixed point space.
$(0, 1) $ is not a fixed point subsets of $\Bbb{R}$ as $f(x) =x^2 $ doesn't fix any point.
Conjecture : $X\subset \Bbb{R}$ fixed point set implies $X=[a, b]$ for some $a, b\in\Bbb{R}$ with $a\le b$
From the first theorem, we know $X$ is connected and hence we need to show $X$ is compact.
Suppose $X$ is not compact. Then we have to construct a continuous function $f:X\to X$ without any fixed point.
As requested, here is an "official answer":
Let $X \subset \mathbb R$. If each continuous function $f: X \rightarrow X$ has a fixed point, then $X = [a, b]$ for some $a, b \in \mathbb R, a \le b$:
$X$ is not empty (if you allow the empty function). It is easy to see that $X$ is connected (as the OP noted in the question). Moreover, it is well-known that a non-empty, connected subset of $\mathbb R$ is homeomorphic to either $(0,1), ( 0, \frac{1}{2}], \{0\}$ or $[0,1]$. For the first two cases, $x \mapsto x^2$ is a continuous function without a fixed point. Hence, $X$ is a singleton or homeomorphic to $[0,1]$ and therefore $X = [a, b], a \le b$.
Vice versa, if $f: [0,1] \rightarrow [0,1]$ is continuous, the Intermediate value theorem implies that $x -f(x)$ has a zero, which is a fixed point of $f$. Hence, $[a, b]$ has the fixed point property.