# For a given metric space, how to show that $d(f(x),x) \ge \epsilon$?

I've got a quick question again. Suppose that we have a compact metric space $X$ which has a corresponding metric $d$. Also we know that $f:X\rightarrow X$ is a continuous map, such that for every $x \in X: f(x) \neq x$.

Ok, now we are given the problem that we have to show somehow that there must exist an $\epsilon >0$, in such a way that $d(f(x),x)\ge \epsilon$ for all $x\in X$

Given hint: Show that a map $g:X \rightarrow \mathbb{R}$ which is defined by $g(x)=d(f(x),x)$ is continuous, and hence attains its bounds.

By the way, this problem is in a chapter which discusses compact spaces, so I guess we have to do something with that, but I'm not sure...

-
Is the given metric space compact? –  Asaf Karagila Mar 21 '13 at 22:55
I think $X$ is going to have to be compact; otherwise it's not generally true that a continuous function attains its bounds. –  Eric Stucky Mar 21 '13 at 22:56
Let $X$ be the set of points $\frac{1}{n}$ for $n \in \mathbb{N}$ with the regular metric topology. Define $f(\frac{1}{n}) = f(\frac{1}{n+1})$. This function is continuous, $f(x) \neq x$, but the result fails. –  Isaac Solomon Mar 21 '13 at 22:56
First of all, prove the hint (you'll need that X is compact - is this in the question?). Now, suppose there is not some e > 0 such that g(x) >= e for all x. Then, for all e' > 0, there is some x such that g(x) < e'. As g is continuous, it will attain both its infimum and its supremum... –  Billy Mar 21 '13 at 22:58
Sorry guys, $X$ is compact indeed.... Thanks –  MSKfdaswplwq Mar 21 '13 at 22:58

If $X$ is compact then $g$ defined in the hint is continuous (it is a composition of continuous functions), and therefore the image of $g$ is a closed and bounded set. Therefore there is a minimum to $\text{Im}(g)$, and since $0$ is not in the image, this minimum is $\varepsilon$ as wanted.
On the other hand, if $X$ is not compact, take $X=(0,\infty)$ with the metric inherited from $\Bbb R$, and take $f(x)=\frac x2$, then $f(x)\neq x$, but $\inf\{d(x,f(x))\mid x\in X\}=0$.