Uniformly Continuous Function Preserves Uniform Convergence

Theorem
Let $X$ be a set.

Let $M$ and $N$ be metric spaces.

Let $(g_n)$ be a sequence of mappings $g_n:X\to M$.

Let $g_n$ converge uniformly to $g:X\to M$.

Let $f:M\to N$ be uniformly continuous.

Then $(f\circ g_n)$ converges uniformly to $f\circ g$.

Proof
Let $\epsilon>0$.

Because $f$ is uniformly continuous, there exist $\delta>0$ such that $d(f(x),f(y))<\epsilon$ for $d(x,y)<\delta$.

Because $(g_n)$ converges uniformly, there exist $N>0$ such that $d(g_n(x),g(x))<\delta$ for $n>N$ and all $x\in X$.

Thus $d(f(g_n(x)),f(g(x)))<\epsilon$ for $n>N$ and all $x\in X$.

Thus $(f\circ g_n)$ converges uniformly to $f\circ g$.