If $f$ is continuous on a compact metric space $X$ and $f:X\to X$, then is it true that $f$ has fixed points? 
If $f$ is continuous on a compact metric space $X$ and $f:X\to X$, then is it true that $f$ has fixed points?

I don't think this is true and I try to find some counterexample. Say $X$ is the compact set $[0,1]$, then how can we find a counterexample $f:[0,1]\to [0,1]$ such that $f(x)\neq x, \forall x$?
 A: Say $X = [0,1] \cup [2,3]$ and $f(x) = x+2$ on $[0,1]$ and $f(x) = x-2$ on $[2,3]$. Then $X$ is compact metric, $f$ is continuous, but $f$ has no fixed points.
The reason $[0,1]$ will not give you a counterexample is because it is convex. Look up Brower's fixed point theorem.
A: Let $X$ be the unit circle and $f$ a rotation by less than $2\pi$.
A: It doesn't, as others have said and given examples, but it might be noteworthy to say a few examples where it does.
Before, just for the sake of completeness, I also give a counter-example: $f:S^0 \to S^0$ the interchange.
Every map $f:D^n \to D^n$ has a fixed point (this is Brouwer's fixed point theorem). This also explains why you can't find an example by searching a function $f:[0,1]\to [0,1]$ (although the result for $D^1$ is simply an application of the intermediate value theorem, and arguably not as worthy of the full name "Brouwer's fixed point theorem" as its higher-dimensional brethren).
Every map $f:\mathbb{R}P^{2n} \to \mathbb{R}P^{2n}$. This is a consequence of the fact that every map $f:S^{2n} \to S^{2n}$ has a point $x$ such that $f(x)=-x$ or such that $f(x)=x$.
And although for general compact spaces the result is not true, it is true that every map from a compact metric space to itself has a non-empty fixed closed set. For this, take $A_n:=f^n(X)$, and let $A:= \bigcap A_n$. One can prove that $f(A)=A$ (one inclusion is trivial, the other needs an argument of compactness). Since $A$ is a decreasing intersection of non-empty compact sets, it is non-empty.
A: It does not have to have a fixed point, as many mentioned. However, it does have a fixed set, i.e there exists a non-empty $A\subset X$ such that
$$f(A)=A.$$
Its proof is very interesting: Starting with $X$ keep applying $f$ to sets, prove that the intersection of all of them is a nonempty set, and satisfies the equality above.
