6. Let the set $\mathbf{A}=\{1,2.3,4,5,6\}$, and the one-to-one mapping $f: \mathbf{A} \rightarrow \mathbf{A}$ satisfies the condition: for any $x$ $\in \mathrm{A}$, $f(f(f(x)))=x$. Then the number of mappings $f$ that satisfy the above condition is ( ).
A. 40
B. 41
C. 80
D. 81
6. $\mathrm{D}$

First, we prove that there does not exist $x \in \mathbf{A}$ such that $f(f(x))=x$ and $f(x) \neq x$. Otherwise, since $f(x) \in \mathbf{A}$, we have $f(f(f(x)))=f(x) \neq x$, which contradicts the known condition. Therefore, for any $x \in \mathbf{A}$, either $f(x)=x$ or $f(x)=x_{1}, f\left(x_{1}\right)=x_{2}, f\left(x_{2}\right)=x$ and $x_{1}, x_{2}, x$ are distinct. Hence, there are only 3 possible scenarios:
(1) For any $x \in A, f(x)=x$. There is only 1 such $f$;
(2) $f$ contains one cycle $a \rightarrow b \rightarrow c \rightarrow a$, and for the other three elements $x=a^{\prime}, b^{\prime}, c^{\prime}$, $f(x)=x$. There are $C_{6}^{3} \cdot (3-1)! - 40$ such $f$;
(3) $f$ contains two cycles $a \rightarrow b \rightarrow c \rightarrow a$ and $a^{\prime} \rightarrow b^{\prime} \rightarrow c^{\prime} \rightarrow a^{\prime}$. There are $\frac{C_{6}^{3} \cdot C_{3}^{3}}{2!} \times (3-1)! \times (3-1)! = 40$ such $f$.
Therefore, there are a total of 81 $f$ that satisfy the requirements.