4. Given the function $f(x)$ for any $x \in \mathbf{R}$, it holds that $f(x+2)=\frac{f(x)-1}{f(x)+1}$, and $f(1)=-2$. Then $f(2013)=$ $\qquad$
4. $\frac{1}{2}$.

Notice that,
$$
\begin{array}{l}
f(x+4)=f(x+2+2)=\frac{f(x+2)-1}{f(x+2)+1} \\
=\frac{\frac{f(x)-1}{f(x)+1}-1}{\frac{f(x)-1}{f(x)+1}+1}=-\frac{1}{f(x)} .
\end{array}
$$

Thus, $f(x+8)=f(x)$.
Then $f(2013)=f(251 \times 8+5)=f(5)$
$$
=-\frac{1}{f(1)}=\frac{1}{2} \text {. }
$$