2. The function $f: \mathbf{R} \rightarrow \mathbf{R}$, satisfies for any real number $x$,
$$
f(1-f(x))=x \text {. }
$$
(1) Please provide a function $f$ that meets the requirement;
(2) Determine $S_{f}=\sum_{k=-2017}^{2018} f(k)$ for all possible values.