Artificial intelligent assistant

Fixed Point Property for a special space? Suppose $X$ is a compact connected metric connected space and for every $\epsilon >0$ , there exists a continuous surjective function $f : X \rightarrow [0,1]$, that for all $y \in [0,1]$, the diameter of the set $f^{-1} (y)$ is less than $\epsilon$. Prove that $X$ has the fixed point property; that is, for all continuous $g : X \rightarrow X$, there exists $x_0 \in X$ that $g(x_0) = x_0$. If we know that for a continuous surjective function $f : X \rightarrow [0,1]$ the diameter of set $f^{-1} (y)$ is zero, then we know that $X$ and $[0,1]$ are homeomorphic, so the statement is proven. But I have no idea for that. Hints are appreciated.

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)$.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy cd11855ad96179183700737a19a94ee7