The condition is very simple $A=\{1,2,3,4\}$ is the domain of a function $f(x)$.
We have to find total number of $f(x)$ such that $fof(x)=x$.
Obviously, It means that $f$ ought to be inverse of itself. What i tried was Making pairs of elements in Domain and then seeing total such possible mappings.
Example: Let $(1,2) and (3,4)$ be the respective pairs and they end up with mapping $\{1\rightarrow2 and 2\rightarrow1 \}$ or $\{2\rightarrow2 and 1\rightarrow1 \}$ and same case with $(3,4)$
This should be giving me an answer of $^4C_2*2=12$
But my book says it's 13. Please someone explain my error or provide a better and elegant method for the same.
You had the right idea but forgot the identity function.