Interesting bijection $\mathbb N\times\mathbb N\to\mathbb N$ $(b)$ Let $A$ be an infinite subset of the set of natural numbers $\mathbb N=\{0, 1, 2, ...\}$. Prove that
there is a bijection $f\colon\mathbb N\to A$. <---- Have done this part with no bigger trouble
$(c)$ Let $A_n$ be the set of natural numbers whose decimal representation ends with exactly
$n − 1$ zeros. For example, $71\in A_1, 70\in A_2$ and $15000\in A_4$. By applying the result
of part $(b)$ with $A = A_n$, construct a bijection $g\colon\mathbb N\times\mathbb N\to\mathbb N$.  <---- I cannot see an obvious of constructing required bijection
 A: Define$$\begin{array}{rccc}B\colon&\Bbb N\times\Bbb N&\longrightarrow&\Bbb N\\&(m,n)&\mapsto&\text{$m$-th element of }A_n\end{array}$$Since each $A_n$ is an infinite subset of $\Bbb N$, and since $\bigcup_{n\in\Bbb N}A_n=\Bbb N$, this makes sense and $B$ is a bijection.
A: From part (b), define $f_n:\mathbb{N}\rightarrow A_n$ to be that bijection you already found.
Notice that all of the $A_n$ are mutually disjoint (a natural number can't have 3 trailing zeros and 4 trailing zeros at the same time), that each $A_n$ is infinite (for example, the set of naturals with no trailing zeros, $A_1$, is clearly infinite; and $k \mapsto k(10)^{n-1}$ is a bijection $A_1\rightarrow A_n$), and also that $\mathbb{N}=\bigcup_{n=1}^\infty A_n$ (every natural number is in one of the $A_n$).
Define $F:\mathbb{N}\times\mathbb{N}\rightarrow\bigcup_{n=1}^\infty A_n$ by $F( i , j)= f_i(j)$. The parameter $ i $ determines which $A_i$ to land in (i.e. how many trailing zeros to use), while the parameter $j$ specifies, via $f_i$, which number in the set $A_i$ to pick out.
Since each $A_i$ is always infinite, and since the disjoint union $\bigcup_{n=1}^\infty A_n = \mathbb{N}$, we have successfully found a bijection $F: \mathbb{N}\times\mathbb{N}\rightarrow\mathbb{N}$.
