Confusion in proof that $C(X,Y)$ is separable From Kechris' Classical Descriptive Set Theory:

(4.19) Theorem If $X$ is compact metrizable and $Y$ is Polish, then $C(X,Y)$ is Polish.

In the proof of separability, we consider
$$
C_{m,n} = \{f \in C(X,Y) : \forall x,y[d_X(x,y) < 1/m \implies d_Y(f(x),f(y))<1/n]\},
$$
and let $X_m$ be a $1/m$-dense set in $X$, i.e. no point in $X$ is further than $1/m$ from an element of $X_m$. Next is the part that confuses me. Kechris writes

Then let $D_{m,n} \subseteq C_{m,n}$ be countable such that for every $f \in C_{m,n}$ and every $\epsilon>0$ there is $g \in D_{m,n}$ with $d_Y(f(y),g(y)) < \epsilon$ for $y \in X_m$.

How do we know that such a set $D_{m,n}$ exists? Of course we could define a countable set of functions with the above property by just declaring that for all $i$ we have $g(x_i) = y_j$ for some $j$ where $\{y_i\}$ is dense in $Y$. However, as far as I know, there is no theorem guaranteeing that given $g:\{x_1,\ldots,x_m\} \to Y$ there is a continuous extension to all of $X$. Tietze's theorem only applies to $\mathbb{R}^n$ as far as I know, not an arbitrary Polish space.
 A: It certainly seems like there's some explanation missing there.
The same proof, explained better, can be found in Srivastava, A Course on Borel Sets, Theorem 2.4.3. Here's the basic idea in case you can't get your hands on a copy.
You can construct $D_{mn}$ as follows. Let $X_m = \{x_1, \dots, x_M\}$.
For each $k$ take a countable cover of $Y$ by sets $\{U^k_i\}$ with diameter less than $1/k$.
Now, fix $k$ and any collection $U^k_{i_1}, \dots, U^k_{i_M}$ of $M$ sets from this $1/k$-cover. If possible, pick an $f\in C_{mn}$ such that $f(x_j)\in U^k_{i_j}$ for each $1\leq j \leq M$. 
Now let $D_{mnk}$ be the union of all these $f$ you chose, for any collection of $M$ open sets as above. Then let $D_{mn}$ be the union over $k$ of all the $D_{mnk}$.
A: Write $X_m=\{ a_1,\dots ,a_N\}$, and consider the set 
$$A=\{ (f(a_1),\dots ,f(a_N));\; f\in C_{m,n}\}\subset Y^N\, .$$
Take any countable dense set $D\subset A$. Then one can write 
$$D=\{ (f(a_1),\dots ,f(a_N));\; f\in D_{m,n}\}$$
for some countable set $D_{m,n}\subset C_{m,n}$. This set $C_{m,n}$ works.
