How many maps $A \overset{f}{\rightarrow} A$ satisfy $f \circ f = f$ with the given set $A=\{a, b, c\}$. A few related questions inside. I am trying to calculate how many maps $A \overset{f}{\rightarrow} A$ satisfy $f \circ f = f$ with the given set $A=\{a, b, c\}$.
I would like to see the explicit mappings and learn how you constructed these mappings by hand, so I can apply these same techniques to future problems.
I'm self-studying this summer and have a few follow up questions, this will help solidify my understanding of the problems being asked. 
Question 1:
What are the explicit mappings for this problem & how did you go about constructing them?
Question 2:
Is there a general procedure to calculate how many such mappings exist for any set A with an arbitrary number of elements? 
Many thanks for the help!
 A: The requirement that $f\circ f=f$ is equivalent to the requirement that if $x\in f[A]$, then $f(x)=x$. That is, $f\upharpoonright\operatorname{ran}f$ must be the identity on $\operatorname{ran}f$, and any function whose restriction to its range is the identity will have the desired property.
Since it’s just as easy, I’m going to generalize your question. Let $A$ be a set of cardinality $n$; I’ll count the functions $f:A\to A$ such that $f\circ f=f$.
Let $B\subseteq A$, and let $m=|B|$; we’ll count the functions from $A$ to $B$ that are the identity on $B$. If $f$ is such a function, we know that $f(x)=x$ for each $x\in B$, but $f(x)$ can be any element of $B$ if $x\in A\setminus B$. Thus, in building such a function we get to make an $m$-way choice $n-m$ times, once for each $x\in A\setminus B$, so there are $m^{n-m}$ such functions. 
For each $m$ there are $\binom{n}m$ subsets of $A$ of cardinality $m$, and each contributes $m^{n-m}$ functions with the desired property, so there are altogether
$$\sum_{m=0}^n\binom{n}mm^{n-m}\tag{1}$$
such functions. For $n=3$ this is 
$$\binom30\cdot0^3+\binom31\cdot1^2+\binom32\cdot2^1+\binom33\cdot3^0=0+3+6+1=10\;.$$
Specifically, there are $3$ constant functions, $6$ functions with $2$-element ranges, and the identity function.
We can use $(1)$ to calculate the number of functions with the desired property for $n=0,1,2,3,4$; we get $1,1,3,10,41$, respectively. This turns out to be the start of the sequence OEIS A000248. This is probably not obvious from the description at the head of the entry, but the third item in the COMMENTS section makes the identification easy:

a(n) is the number of ways to select a set partition of {1,2,...,n} and then designate one element in each block (cell) of the partition.

If $A=\{1,2,\ldots,n\}$, a function $f:A\to A$ with the desired property does exactly that: the designated elements are the members of the range of $f$, and $f$ sends each element of a given block of the partition to the designated element of that block.
The FORMULA section of the entry gives a formulat equivalent to $(1)$, assorted generating functions, a recurrence (that isn’t especially nice), and an asymptotic estimate, but no closed form, so in all likelihood no closed form is known. In practice you would probably use $(1)$ to get the number of such functions.
A: The only bijective map that satisfies the condition is the identity. So the other maps are not surjective.
Suppose the image of $f$ is $\{a,b\}$. Then $a=f(x)$ for some $x$ and so $f(a)=f(f(x))=f(x)=a$; similarly $f(b)=b$. Therefore we're left with $f(c)=a$ or $f(c)=b$. This gives two maps.
Therefore we have $2\cdot 3$ maps having their image with cardinality $2$.
Suppose the image of $f$ is $\{a\}$. Then $f(a)=a$ as before; moreover, the restriction on the image forces $f(b)=a$ and $f(c)=a$. Thus only one map exists.
Therefore we have $1\cdot 3$ maps having their image with cardinality $1$.
In total, $1+6+3=10$ maps satisfy the condition.
