TITLE: Sums of $f(f(x))=1-x$
QUESTION [6 upvotes]: We consider all real functions $f$ with the property $f(f(x))=1-x$ for all $x\in\mathbb{R}$. We define for each such function $f$ the sum:
$$S_f=f(-2017)+f(-2016)+...+f(-1)+f(0)+f(1)...+f(2017)+f(2018)$$ 
Determine the set of all values ​​that such sums $S_f$ can take.
To find solutions for function $f$ I used this solution.

REPLY [10 votes]: Since $$1-f(x)=f(f(f(x))) = f(1-x)\implies \boxed{f(1-x)+f(x)=1}$$ so 
$$ f(-2017)+f(2018)=1$$
$$ f(-2016)+f(2017)=1$$
$$ \vdots$$
$$ f(-1)+f(2)=1$$
$$ f(0)+f(1)=1$$
So $S_f = 2018$.