Assume that $X=\{a,b\}\\$
There must be a contradiction in the following statements: I.e. there is something lurking here which tells us that this is not a function.
$\#\{x:f^{1}(x)=a\}=1\\$
$\#\{x:f^{2}(x)=a\}=2\\$
$\#\{x:f^{1}(x)=b\}=1\\$
- $\#\{x:f^{2}(x)=b\}=0\\$
What I Know: we can show this combinatorially
I know the information encoded as a matrix (of rows) of preimages with entries $S_{ij}=\#f^{-j}(x_i)$ is given by $S=[[1,2],[1,0]]$. For example, letting $x_{1}=a$ and $x_{2}=b$ and the number of elements which under two applications of $f$ yield the first domain element, $x_{1}=a$ , is given by $S_{(1,2)}=2$
Reverse engineering this gives two possible forward "image" matrices (of rows) with entries $F_{ij}=f^{j}(x_i)$ one $a$ and one $b$ in column 1 and two $a$'s in column 2.
Thus the options are either
$F_{1}=\left(\begin{array}{ccc}
f(a)=a & f(f(a))=a \\
f(b)=b & f(f(b))=a \\
\end{array}\right)$
or
$F_{2}=\left(\begin{array}{ccc}
f(a)=b & f(f(a))=a \\
f(b)=a & f(f(b))=a \\
\end{array}\right)$
Both of which contradict f is functional as $F_{1}$ implies $f(b)=b$ and $f(b)=a$ by row 2, since the entries correspond to $F_{ij}=f^{j}(x_i)$. Likewise in $F_{2}$ it is implied that implies $f(a)=b$ by entry (1,1) and $f(b)=a$ by entry (1,2).
So combinatorially we can see the problem, but I'd like to be able to show the issue from the mere list of set size specifications at the top of the post.
If $\ f\ $ were a function from $\ X\ $ to $\ X\ $ satisfying conditions $3$ and $4$, then condition $4$ tells us that $\ f(b)=a\ $, since $\ f(b)=$$b\implies$$ f^2(b)=b\implies$$\#\{x: f^2(x)=b\}\ge1\ $. Condition $3$ then tells us that $\ f(a)=b\ $, because we would otherwise have $\ \#\{x: f(x)=b\}=0\ $. Thus, for $3$ and $4$ to be satisfied, we must have $\ f(a)=b\ $ and $\ f(b)=a\ $. But this function does not satisfy $4$, because, once again, $\ f^2(b)=b\ $.
Thus, there is no function from $\ X\ $ to $\ X\ $ which can satisfy both conditions $3$ and $4$, let alone all four of the conditions.