TITLE: Is a continuous function locally uniformly continuous?
QUESTION [10 upvotes]: Assume a function, $f : X \to Y$, mapping between two metric spaces, $X,Y$, is pointwise continuous, i.e. for every $\varepsilon >0$ and $x \in X$ there exists a $\delta>0$ such that 
$$
\|x-x'\|_X < \delta
\implies
\|f(x) - f(x')\|_Y < \varepsilon
, \qquad
\forall x' \in X.
$$
Does this imply $f$ is locally uniformly continuous, i.e. for every $x \in X$ there exists a neighbourhood $U \subset X$ such that for every $\varepsilon > 0$ there exists a $\delta > 0$ such that 
$$
\|x_1-x_2\|_X < \delta
\implies
\|f(x_1) - f(x_2)\|_Y < \varepsilon
, \qquad
\forall x_1,x_2 \in U?
$$
A positive answer without proof, under the condition that $X$ and/or $Y$ are locally compact, is implied here.

REPLY [6 votes]: If $X$ is locally compact, the result follows from Cantor's theorem. If $X$ is not locally compact, the result is not necessarily true as Stefan's example shows.