How many maps of this set into itself question? Suppose we have a set $(1, 2, ... n)$, which has $2^n$ subsets. I am taking an introduction to analysis course, and I don't seem to understand the following two questions about this set:


How many maps of this set into itself?
How many maps of this set onto itself?


I understand the definitions of "into" and "onto" in this context, but I'm struggling with understanding what exactly they're asking. Any help?
Call the set $S$. By "into" they mean any map $f\colon S\rightarrow S$. By "onto" they mean a map $f\colon S\rightarrow S$ whose image is $S$ itself (i.e. $f(S)=S$). That is, each element in the codomain is mapped to by some element in the domain.
There are $n^n$ maps from an $n$ element set to itself. 

A surjection from a finite set to itself is also an injection, hence a bijection. (Proof: If $f\colon X=\{1, \dotsc n\}\to X$ is a surjection, then $\{f^{-1}(x) \mid x\in X\}$ is a partitions $X$ into $n$ nonempty disjoint sets, so every $f^{-1}(x)$ must have exactly one element.) Thus, the number of surjections from $X$ to itself equals $n!$, as that is the number of bijections from $X$ to itself.

Note that in the general case, computing the number of surjections from a set of $n$ elements to a set of $k$ elements is more involved, and is answered here and here.