7. Let $M=\{1,2,3,4,5\}$. Then the number of mappings $f: M \rightarrow M$ such that
$$
f(f(x))=f(x)
$$

is $\qquad$
7. 196.

For the case where $M$ contains $n$ elements, from
$$
f(f(x))=f(x) \text {, }
$$

we know that for any $a \in M$ (let $f(c)=a$), we have
$$
f(f(c))=f(a)=f(c)=a .
$$

If the range of $f$ contains $k$ elements, then the $n-k$ elements of set $M$ that are not in the range have $k^{n-k}$ possible mappings. Therefore, the number of such mappings $f$ is $\mathrm{C}_{n}^{k} k^{n-k}$.
Thus, the number of mappings $f$ that satisfy the condition is
$$
\sum_{k=1}^{n} \mathrm{C}_{n}^{k} k^{n-k} \text {. }
$$

Taking $n=5$, the number of mappings $f: M \rightarrow M$ is
196.