I have been struggling with this problem for a while now. Any help is appreciated!
(b) Suppose that $f:X \to X$ is an isometry of $X$ into itself. Show that if $(X,d)$ is compact, then $f$ is surjective, ie, $f(X)=X$.
I was able to solve this, but I am struggling with the followup question:
(c) Is the conclusion of (b) true if $(X,d)$ is not assumed to be compact? In other words, is there a (necessarily noncompact) metric space $X$ such that $X$ is isometric to a proper subspace of itself? Give a proof or counterexample.
Simple example: $f:\mathbb{N}\to \mathbb{N}$, $n\mapsto n+1$ where $\mathbb{N}$ is a discrete metric space.