Concerning the Proof that a Union of a sequence of Countable Sets is Countable Theorem 2.12 of Principles of Mathematical Analysis by Rudin states that the union S of a sequence of countable sets (En) is countable. In the proof, Rudin constucts the following array:

and he then iterates through it to obtain the following:

and he concluded by stating that if any two sets have elements in common, then they appear more than once in the above sequence therefore we take a subset T of the set of all postitive integers and that subset T is equivalent to the union. Hence it is countable. To my understanding, to establish a set is countable, we must construct a 1-1 onto map from the set of positive integers(or a subset of it, T in this case) to that set. What I assume the author does here is he constructs the following function:
$$f: T ↦ S$$
$$f(n_1)=x_{11}$$
$$f(n_2)=x_{21}$$
$$f(n_3)=x_{12}$$
$$.$$
$$.$$
$$.$$
where the n's are elements of T in order.
Is what I said correct? Is the function above valid?
Thank you.
 A: $\textbf{tl;dr:}$ yes you are right.
You can think of an infinite sequence $a_1,a_2,a_3,\dots$ of elements $a_i$ of some set $A$ as a function from the set of positive integers to $A$ given by $n \mapsto a_n$ (this is in fact the formal definition of a sequence). Then the list Ruding wrote (namely $x_{11} ; x_{21} ; x_ {12} \dots$) is the same thing as giving a (surjective) function from $\mathbb{N}$ to $\cup_n E_n$.
Sometimes "$A$ is countable" is defined to mean that there exists a surjection $f:\mathbb{N} \rightarrow A$. This is equivalent, when $A$ is infinite, to the definition you seem to be using (i.e. that there is a $ \textit{bijection }g:\mathbb{N}\rightarrow A$). That is basically because given a surjection $f: \mathbb{N} \rightarrow A$ you can restrict $f$ to some subset $T \subseteq\mathbb{N}$ so that $f|_T : T \rightarrow A$ is a bijection. And it's easy (for example using that $\mathbb{N}$ is well-ordered) to find a bijection between $T$ and $\mathbb{N}$.
Possibly interesting: if I'm not mistaken the fact that any surjection can be restricted to a bijection is equivalent to the axiom of choice.
