2. Given $f(x)=\frac{1+x}{1-3 x}, f_{1}(x)=f(f(x))$, $f_{n+1}(x)=f\left(f_{n}(x)\right)\left(n \in \mathbf{Z}_{+}\right)$.
Then $f_{2017}(-2)=()$.
(A) $-\frac{1}{7}$
(B) $\frac{1}{7}$
(C) $-\frac{3}{5}$
(D) $\frac{3}{5}$
2. D.

From the problem, we know that $f_{1}(x)=f(f(x))=\frac{x-1}{3 x+1}$. Then, $f_{2}(x)=f\left(f_{1}(x)\right)=f\left(\frac{x-1}{3 x+1}\right)=x$, $f_{3}(x)=f\left(f_{2}(x)\right)=f(x)=\frac{1+x}{1-3 x}$.

Thus, $f_{3 n+1}(x)=f_{1}(x)=\frac{x-1}{3 x+1}$,
$$
\begin{array}{l}
f_{3 n+2}(x)=f_{2}(x)=x, \\
f_{3 n+3}(x)=f_{3}(x)=\frac{1+x}{1-3 x} .
\end{array}
$$

Therefore, $f_{2017}(x)=f_{1}(x)=\frac{x-1}{3 x+1}$
$$
\Rightarrow f_{2017}(-2)=\frac{-3}{-5}=\frac{3}{5} \text {. }
$$