consider $h: X \rightarrow X$ continuous. I want to prove there's $x \in X$ that $h(x)=x$. for $\epsilon > 0$ consider $foh -f : X \rightarrow [0,1]$.because $f$ is surjective, there is $x \in X$ that $(foh -f) (x) \leq 0$ and there is $y \in X$ that $(foh -f) (y)\geq 0$. $foh -f $ is continuous and $X$ is connected, so there exists $t \in X$ that $(foh -f)(t) =0$. then $t , h(t) \in f^{-1}(f(t))$. so $d(t , h(t)) < \epsilon$.so we can have a sequence $t_n$ that $d(t_n , h(t_n)) < 1/n$. because $X$ is compact we can find $s \in X$ that $s = h(s)$.