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|$
(C)
2.【Analysis and Solution】(1) Given $f(x)=x, 2 \leqslant x \leqslant 3$ and the period is 2, we have $f(x+2)=x$.
(2) Since $f(x)$ is even, we get $f(x)=-x+2,-1 \leqslant x \leqslant 0$. Combining (1) and (2), the answer is (C).