Counting All Permutations I have been asked to decide and prove whether the set of all functions on the natural numbers (from N to N) is countable or uncountable.  Our book provides a theorem that an infinite union of countable sets is countable.  I reasoned that a function could be represented by a set of (input, output) pairs.  A function on a finite subset of the natural numbers would obviously be countable under this arrangement.  A function on an infinite subset would also be countable with a bijection between input and N.  Therefore the set of all functions on N could be considered an infinite union of countable sets, making it countable.  But when I looked at other proofs I found out this is wrong!  The set of all permutations is considered an uncountable set.  Where did I go wrong?
 A: Every set is expressible as a union of countable sets; simply take a union over all of the  singleton subsets of $X$, i.e.  $X=\bigcup_{x\in X}\{x\}$. If we were to accept that arbitrary unions of countable sets were countable, we'd have to believe every set is countable! That can't be right.
Not just any union of countable sets is countable. There has to be a cap on the number of sets being collected together. The correct statement is that countable unions of countable sets are countable.
There is an additional problem, with considering a function $X\to X$ as a certain kind of collection of subsets of the set $X^2$: here, the set of functions is not the same as the union of them.
As an aside, not every function $X\to X$ on a set $X$ is considered a "permutation" of $X$. Such a map is only a permutation if it is both injective and surjective, i.e. a bijection.
A: Your problem is with the sentence " A function on an infinite subset would also be countable with a bijection between input and N" Even though the input is countable, the number of functions is uncountable.  To show that the set is uncountable, it suffices to show that it has an uncountable subset.  Given an infinite binary string $n_i$ for $i \in \Bbb N$ (including $0$), we can make a permutation by swapping $2i$ and $2i+1$ if $n_i=1$ and leaving them in place if $n_i=0$.  This gives a different permutation for each string.  As the strings are uncountable, so are the permutations.
A: (This answer deals with all functions as in the question, not all permutations as in the title - not sure which you meant.)
The set $F$ of all functions from $\Bbb N$ to $\Bbb N$ is not countable.  A proof of this should remind you of Cantor's proof that the interval $(0,1)$ is uncountable (if you have seen this proof).
So, assume that $F$ is countable.  Then we can write
$$F=\{\,f_0,f_1,f_2,\ldots\,\}\ .$$
Now define a function $f:{\Bbb N}\to{\Bbb N}$ by
$$f(n)=f_n(n)+1\ .$$
Can you complete the proof by finding a contradiction?
