2. Let $f(x)$ be a periodic function with period 2 defined on the set of real numbers, and it is an even function. It is known that when $x \in[2,3]$, $f(x)=x$. Then, when $x \in[-2,0]$, the analytical expression of $f(x)$ is
(A) $f(x)=x+4$;
(B) $f(x)=2-x$;
(C) $f(x)=3-|x+1|$;
(D) $f(x)=2+|x+1|$.
2. (C)
(1) Given $f(x)=x, 2 \leqslant x \leqslant 3$ and the period is 2, we have
$$
f(x)=\left\{\begin{array}{l}
x+4, -2 \leqslant x \leqslant -1, \\
x+2, 0 \leqslant x \leqslant 1 .
\end{array}\right.
$$
(2) Since $f(x)$ is even, we get
$$
f(x)=-x+2, -1 \leqslant x \leqslant 0 .
$$

Combining (1) and (2) gives the answer (C).