Find all $a\in\mathbb{R} $ for which there exists a function $f : \mathbb{R}\to\mathbb{R} $ , such that
(i) $f(f(x))=f(x)+x$, for all $x\in\mathbb{R} $,
(ii) $f(f(x)–x)=f(x)+ax$, for all $x\in\mathbb{R} $
Normally in such functional equations, I'd put different values of $x$ (like $x+1$, $x+2$ etc) and try to get an equation for $f(x)$. But here I'm not getting anywhere by that method. I can't use the coefficient comparison method either, because $f(x)$ may not be a polynomial.