Let $M,N$ be metric spaces such that $X \subset M$ is dense in $M$, $f:M \rightarrow N$ is continuous and $f|_X$ is uniformly continuous, then $f$ is uniformly continuous.
My proof:
We want to prove that for every $\epsilon > 0$ there is a $\delta' > 0$ such that
$$ d(x,y) < \delta' \implies d(f(x),f(y))< \epsilon \quad \forall x,y \in M $$
So let $\epsilon > 0$ and let’s find such $\delta' > 0$.
Since $f$ is continuous, then for every $x_0 \in M$ there is a $\delta_{x_0} > 0$ such that
$$ d(x,x_0) < \delta_{x_0} \implies d(f(x),f(x_0)) < \epsilon/3 \quad \forall x \in M $$
Since $f|_X$ is uniformly continuous then there is a $\delta > 0$ such that
$$ d(\hat x,\hat y) < \delta \implies d(f|_X(\hat x),f|_X(\hat y)) < \epsilon/3 \quad \forall \hat x,\hat y \in X $$
Now let $x,y \in M$. Take $\hat x, \hat y \in X$ such that
- $d(x,\hat x) < \min \{\delta/3, \delta_{\hat x}\}$
- $d(y,\hat y) < \min \{\delta/3, \delta_{\hat y}\}$
From that, we get that
- $d(f(x),f_X(\hat x)) < \epsilon / 3$
- $d(f(y),f_X(\hat y)) < \epsilon / 3$
Then, if $d(x,y) < \underbrace{\delta / 3}_{\delta'}$ we get that
$$ d(\hat x, \hat y) \leq d(\hat x, x) + d(x, y) + d(\hat y,y) \leq 3\cdot \delta/3 = \delta $$
which implies that
$$ d(f|_X(\hat x),f|_X(\hat y)) < \epsilon/3 $$
therefore
$$ d(f(x),f(y)) \leq d(f(x),f_X(\hat x)) + d(f_X(\hat x),f_X(\hat y)) + d(f_X(\hat y),f(y)) \leq 3 \cdot \epsilon/3 = \epsilon $$
I took a more than expected to reach this solution. I'm satisfied with it, but still not 100% sure of my work. Can someone please check my work so far? Thanks!