I have a continuous map $f: X \to X$ on a compact metric space and I am trying to show that $inf \{ d(x,f(x)) : x \in X \}$ is attained.
My thoughts so far are to use sequential compactness to obtain a sequence of points $x_n$ so that $d(x_n, f(x_n))$ tends to the infimum, but I'm struggling to make anything of this.
Thanks for any help
Hint: $x \mapsto d(x,f(x))$ is continuous.