People usually meant the following:
Thm. Let $X$ and $Y$ be metric spaces with $Z$ dense in $X$. If $f\in C(Z\to Y)$ is uniformly continuous, then there is a function $F\in C(X\to Y)$ with $F|_Z=f$.
Proof. It suffices to show that, for each $x\in X$, the limit $\lim_{z\to x}{f(z)}$ is well-defined.
For any $\epsilon\in\mathbb{R}^+$, let $\delta(\epsilon)$ be such that $$d(x,y)<\delta(\epsilon)\Rightarrow d(f(x),f(y))<\epsilon$$
Existence: Suppose $\{x_n\}_n\in Z^{\omega}$ converges to $x$. Then $$\limsup_{n,m\to\infty}{d(x_n,x_m)}\leq\left(\limsup_{n\to\infty}{d(x_n,x)}\right)+\limsup_{m\to\infty}{d(x,x_m)}=0<\delta(\epsilon)$$ and so $$\limsup_{n\to\infty}{d(f(x_n),f(x_m))}<\epsilon$$ Thus $\{f(x_n)\}_n$ is Cauchy.
Uniqueness: Suppose $\{x_n\}_n,\{y_n\}_n\in Z^{\omega}$ converge to the same point, with $f(x_n)\to a$ and $f(y_n)\to b$. Fix $\epsilon$. $$\limsup_{n\to\infty}{d(x_n,y_n)}=0<\delta(\epsilon)$$ and so $$\limsup_{n\to\infty}{d(f(x_n),f(y_n))}\leq\epsilon$$ Now send $\epsilon\to0^+$. █
I leave the following exercises to you:
- The $F$ so defined is unique and
- The condition on $f$ cannot be weakened to just continuity. (Hint: Pick a function $f\in\mathbb{Q}\to\mathbb{R}$ discontinuous at $\pi$.)