Consider two metric spaces $(X,d_X)$, $(Y,d_Y)$, and a function $f: X\to Y$, $f$ is uniformly continuous.
A function $w: [0,\infty)\to [0,\infty]$ is called a modulus of continuity for $f$, if:
$w(0)=0$
$lim_{s\to 0}w(s)=0$
for all $x,z\in X$, $d_{Y}(f(x),f(z))\leq w(d_{X}(x,z))$
Then prove that $f$ is uniformly continuous if and only if there exists a modulus of continuity for $f$.
I think I have an idea on how to prove one direction, suppose there exists a modulus of continuity $w$ for $f$, then fix $\varepsilon>0$, since $lim_{s\to 0}w(s)=0$, there exists $\delta>0$ such that for any $|s|<\delta$, we have $w(s)<\varepsilon$, then we have for any $x,z\in X$ such that $d_{X}(x,z)<\delta$, we have $d_{Y}(f(x),f(z))\leq w(d_{X}(x,z))<\varepsilon$, which means $f$ is uniformly continuous.
Could anyone give me some ideas on how to prove the reverse? Thank you!