Problem. Find all continuous functions $ f : \mathbb R \to \mathbb R $ such that for all $ x \in \mathbb R $, we have $$ f ( 1 - x ) = 1 - f \big( f ( x ) \big) \text . $$
I have obtained that $ f ( x ) = f \bigg( f \Big( f \big( f ( x ) \big) \Big) \bigg) $ for all $ x \in \mathbb R $, but can't go any further. To see this, we substitute $ x = f \big( f ( x ) \big) $ to get $$ f \Big( 1 - f \big( f ( y ) \big) \Big) = 1 - f \bigg( f \Big( f \big( f ( x ) \big) \Big) \bigg) \\ \implies f \big( f ( 1 - y ) \big) = 1 - f \bigg( f \Big( f \big( f ( x ) \big) \Big) \bigg) \\ \implies 1 - f ( y ) = 1 - f \bigg( f \Big( f \big( f ( x ) \big) \Big) \bigg) \\ \implies f(y) = 1 - f \bigg( f \Big( f \big( f ( x ) \big) \Big) \bigg) \text . $$ I am guessing the only solutions are $ f ( x ) = x $ and $ f ( x ) = \frac 1 2 $. Does anyone have a proof?
Edit: I can prove that if $ f $ is continuous and $ f \Big( f \big( f ( x ) \big) \Big) = x $ for all $ x \in \mathbb R $, then $ f ( x ) = x $ is the only solution. But the condition here is slightly weaker than that, and that's why $ f ( x ) = \frac 1 2 $ also works. But is it possible to adapt the proof?
First note: There are other (continuous but non-polynomial) solutions. For example $$f(x) = \begin{cases} 0 & \text{if $x < 0$} \\ x & \text{if $0 \leq x \leq 1$} \\ 1 & \text{if $x > 1$} \end{cases}$$
More generally: The class of functions that are equal to the identity on the interval $[\frac{1}{2}-a,\frac{1}{2}+a]$ for $0 \leq a \leq \infty$ and constant* (with respective value $\frac{1}{2}-a$ or $\frac{1}{2}+a$) outside that interval. So the two you found are the extreme cases of this class, and its only polynomial ones.
I'm fairly confident these are all solutions*. I'd try something along these lines: Let $R$ be the range of $f$. From your identity $ffff = f$ follows that $fff(x) = x$ for all $x \in R$. Now let $\bar f$ be the restriction of $f$ to $R$. Given that $\bar f \bar f \bar f = id$ on $R$, you can show that $\bar f$ is bijective. Also, by continuity and the intermediate value theorem, $R$ must be connected (i.e. if $a<b<c$ and $a,c \in R$ then $b \in R$). This can be used to show that $\bar f$ is the identity on $R$ (e.g. using that every continuous bijection on an interval is monotonic). Now use the original functional equation to show that if $M = \sup(R)$ then $m = \inf(R) = 1 - M$, that $M,m \in R$ and that for all $x>M$ we have $f(x)=f(M)=M$* (the latter can be proved by contradiction). Similarly, if $x<m$, then $f(x)=f(m)=m$*.
*Corrected after comment: for all $x$ outside $R$, it's necessary and sufficient that
i) $f(x) \in R$
ii) $f$ is continuous
iii) the graph has rotational symmetry of order 2 at the centre $(\frac{1}{2},\frac{1}{2})$