Q:

If $f:X\rightarrow X$ is continuous and $(X,d)$ is compact, show there is $\epsilon>0$ such that $d(x,f(x))>\epsilon$ for all $x\in X$.

If $f:X\rightarrow X$ is a continuous function with no fixed points and $(X,d)$ is compact, show there is some $\epsilon>0$ such that $d(x,f(x))>\epsilon$ for all $x\in X$. 

My hope is to argue as follows, but I seem to be ending up with a slightly stronger statement which is what worries me a bit. Since $X$ is compact we know that $X\times f(X)$ is compact and therefore $d: X\times f(X)\rightarrow (0,\infty)$ has compact image. So $d$ attains a minimum, thus there is some $\epsilon>0$ for which $d(x,f(x))\geq \epsilon$ for all $x\in X$. Does this seem ok? 

A:

No, this is not correct. It doesn't follow from your assumptions that the range of $d$ restricted to $X\times f(X)$ is a subset of $(0,\infty)$. You are only assuming that, for each individual $x\in X$, $x\neq f(x)$.
Use the fact that the map$$\begin{array}{ccc}X&\longrightarrow&[0,\infty)\\x&\mapsto&d\bigl(x,f(x)\bigr)\end{array}$$is continuous with compact domain and such that $0$ doesn't belong to its range. So, the range is contained in some set of the type $[\varepsilon,M]$ for some $\varepsilon,M\in(0,\infty)$ (and $\varepsilon\leqslant M$).

