the proof I learned from Henno Brandsma's answer: Let $X$ be compact Hausdorff (no metric is needed), and define $A_0 = X$, $A_{n+1} = f[A_n]$; then all $A_n$ are compact non-empty, and the $A_n$ are decreasing. Try to show that $A = \cap_n A_n$, which is also compact and non-empty, satisfies $f[A] = A$.
Another non-constructive way to show this is to consider the poset $\mathcal{P} = \{ A \subset X \mid A, \mbox{closed, non-empty and } f[A] \subset A \}$, ordered under reverse inclusion. Then an upper bound for a chain from $\mathcal{P}$ is the (non-empty) intersection, and a maximal element (by Zorn one exists) is a set $A$ with $f[A] = A$.