Solution (source code)

= Solution

If $A_n$ are countable, choose enumerations and map each element of $\bigcup_nA_n$ to the first pair $(n,k)$ at which it occurs. Since $\mathbb N^2$ is countable, the union is countable.

A periodic <function> of period $k$ is determined by its $k$ values on a complete residue system. Thus all periodic <functions> form a countable union over $k$ of the countable sets $\mathbb N^k$, and are countable.

The set of bijections $\mathbb N\to\mathbb N$ is uncountable. Indeed, each binary <sequence> determines a bijection that swaps $2j-1$ and $2j$ exactly when its $j$th bit is one. This is an injection from the uncountable set of binary <sequences>.