This can be done by induction. Suppose that the set S=C⁢(n1,…,nk) has already been chosen for some k≥0. As X is separable, S can be covered by a sequence of closed setsS1,S2,…. Replacing Sj by Sj∩S, we suppose that Sj⊆S. Then, remove any empty sets from the sequence. If the resulting sequence is finite, then it can be extended to an infinite sequence by repeating the last term.
We can then set C⁢(n1,…,nk,nk+1)=Snk+1.

We now define the functionf:𝒩→X. For any n∈ℕ choose a sequence xk∈C⁢(n1,…,nk). Since this has diameter no more than 2-k it follows that d⁢(xj,xk)≤2-k for j≥k. So, the sequence is Cauchy (http://planetmath.org/CauchySequence) and has a limit x. As the sets C⁢(n1,…,nk) are closed, they contain x and,

⋂k=1∞C⁢(n1,…,nk)≠∅.

(2)

In fact, this has diameter zero, and must contain a single element, which we define to be f⁢(n).

This defines the function f:𝒩→X. We show that it is continuous. If m,n∈𝒩satisfymj=nj for j≤k then f⁢(m),f⁢(n) are in C⁢(m1,…,mk) which, having diameter no more than 2-k, gives d⁢(f⁢(m),f⁢(n))≤2-k. So, f is indeed continuous.

Finally, choose any x∈X. Then x∈C⁢() and equation (1) allows us to choose n1,n2,… such that x∈C⁢(n1,…,nk) for all k≥0. If n=(n1,n2,…) then x and f⁢(n) are both in the set in equation (2) which, since it is a singleton, gives f⁢(n)=x. Hence, f is onto.