I'm busy with a topology course, but the following question has me somewhat stumped. The entire question is, let $(X,d)$ be a metric space and $f:X \rightarrow X$ be continuous. Show that $X \rightarrow R$, $x \mapsto d(x,f(x))$ is continuous.
I've tried proving it with the old-fashioned $\epsilon$-$\delta$ definition, but I quickly run out of options with that approach. If someone could give me a nudge in the right direction, it would be much appreciated!