Let $X$ be a connected and contractible topological space. Prove that
$$ \forall f: X \mapsto X\quad\exists x \in X\quad \text{such that}\quad f(x)=x. $$
I suppose one has to use Brouwer's fixed point theorem since $X$ is homotopic equivalent to $\overline{D}^2$, but I do not know how to use the homotopy function to prove this properly.
This is an exercise from my algebraic topology class. But I have a feeling this cannot be true because if we choose $X=\mathbb{R}$ and $f(x)=x+1$ it is obvious not true. Is this statement true if $X$ is compact?
Compactness is not enough. For example, let $X =\{0,1\}$ with the trivial topology. Then $X$ is compact, connected and contractible, and every map $f: X\to X$ is continuous. But there is a map $f:X\to X$ that has no fixed point.
For a generalization of Brouwer's fixed point theorem, there's Schauder fixed-point theorem.