I would appreciable any insight you give to solve this type of question:
How many $f: \{1,2,3\}\to \{1,2,3\}$ satisfy $f(f(x))=f(f(f(x)))$ for all $x$?
Normally questions of this type I used try by guessing, until I can't see any more possibilities. But I don't like this way of solving, do you know a theorem or some tool to solve this type of question with certainty?