By countable sets, I refer to countably infinite sets.
We can very well prove that the natrual numbers and $\mathbb{N} \times \mathbb{N}$ have the same cardinality, for a bijection take the Cantor Pairing function. However, wouldn't a similar argument work for proving the countable union of countable sets? Can't we create a bijection between the union and $\mathbb{N} \times \mathbb{N}$.
If $(A_i)_{i \in N}$ is a family of countable sets(i.e. there is a function $f$ such that $f(i)=A_i$) and for each $i$ there is a bijective function $g_i \colon N \to A_i$. Let $U = \cup_{i \in \mathbb{N}}$ and let $h:U \to \mathbb{N} \times \mathbb{N}$.
Now for each element $u \in U$ let $h \colon U \to \mathbb{N}, h(u)=\text{min} \{ i \in N | u \in f(i) \} $. Let's now definie $p:U \to \mathbb{N} \times \mathbb{N}, p(u)=(h(u), g_{h(u)}^{-1}(u))$.
Now let $u$ and $v$ be two elements of $U$. $p(u)=p(v) \implies h(u)=h(v) \text{ and } g_{h(u)}^{-1}(u)=g_{h(v)}^{-1}(v)$. Because $g_{h(u)}=g_{h(v)}$ is bijective we have that $u=v$.
$p$ is injective so there is an injection from $U$ to $N$. Now for an injection from $N$ to $U$ take $g_0$. And we can now use the Cantor Schroder Bernstein theorem to prove that these two bijections give us an injection. From what I know the proof of Cantor Bernstein does not use the axiom of choice.
Where is does my argument fail?(I know it is wrong since the countable union proof requires the axiom of choice)