A function $f:\mathbb{R}\to\mathbb{R}$ such that $f^{-1}(x)=1-f(x)$? Does a function $f:\mathbb{R}\to\mathbb{R}$ such that $f^{-1}(x)=1-f(x)$ exist?

Edit:
I tried with different “simple” forms of function ($ax+b$, polynomes, $ae^{bx}+c$) without any inside as where to go.
So I don't even know how to solve equations with a function and its inverse in it.
 A: Partition $\mathbb{R}$ according to the equivalence relation $x\sim y$ if and only if $x=y$, or $x=1-y$, or $1-x=y$. 
There is one class with one element, $\{1/2\}$ and the rest have two elements. 
Partition the classes with two elements in two disjoint sets of the same cardinality $A$, $B$. Let $H$ be a bijection $H:A\to B$. Fix an order within each element of $A$ and within each element of $B$, such that for an element $\{a_1,a_2\}\in A$ we can name the first element $a_1$, and the second $a_2$. Likewise for elements of $B$. 
Consider each element $\{a_1,a_2\}\in A$ and its corresponding pair in $B$ defined by the bijection $H$, say $\{b_1,b_2\}=H(\{a_1,a_2\})\in B$, define $g(a_1)=b_1$, $g(a_2)=b_2$, $g(b_1)=a_2$, and $g(b_2)=a_1$. Define also $g(1/2)=1/2$. 
Then $g:\mathbb{R}\to\mathbb{R}$ is a bijection of $\mathbb{R}$ such that $1-g(1-g(x))=1-x$. 
Define $f(x)=1-g(x)$. Then $f:\mathbb{R}\to\mathbb{R}$ is bijective, since it is a composition of the bijections $g$ and $1-x$, is a function that satisfies $f(f(x))=1-x$. Therefore, composing with $f^{-1}$, we get $$f^{-1}(x)=1-f(x)$$
A: Here is a geometric approach which is equivalent to the solution from user582578 above:
Consider the graph of $f$ i.e. $\{(x,f(x))| x \in \mathbb{R} \}$. The transformation $f \to f^{-1}$ reflects this graph in the line $x=f(x)$. The transformation $f \to 1-f$ reflects this graph in the line $f(x)=\frac{1}{2}$.
So $f^{-1} = 1-f$ means that $f$ has a graph such that its reflection in $x=f(x)$ and its reflection in $f(x)=\frac{1}{2}$ are the same.
Given any $a,b \in \mathbb{R} \backslash \{ \frac{1}{2} \}$ with $a \ne b$ consider the (irregular) octagon with vertices
$\{P_0=(a,b),P_1=(b,a),P_2=(b,1-a),P_3=(1-a,b),$
$P_4=(1-a,1-b),P_5=(1-b,1-a),P_6=(1-b,a),P_7=(a,1-b)\}$
$f \to f^{-1}$ transforms this octagon as follows:
$P_0 \leftrightarrow P_1, P_2 \leftrightarrow P_3, P_4 \leftrightarrow P_5, P_6 \leftrightarrow P_7$
whereas $f \to 1-f$ transforms the octagon as follows:
$P_0 \leftrightarrow P_7, P_1 \leftrightarrow P_2, P_3 \leftrightarrow P_4, P_5 \leftrightarrow P_6$
so if the graph of $f$ contains the points $\{P_0, P_2, P_4, P_6\}$ then both transformations will map these points to $\{P_1, P_3, P_5, P_7\}$ and we have $f^{-1}=1-f$ for the restriction of $f$ to the domain $\{a,b,1-a,1-b\}$. Reading off the co-ordinates of $\{P_0, P_2, P_4, P_6\}$ we have
$f(a) = b\\f(b) = 1-a\\f(1-a) = 1-b\\f(1-b) = a$
and so
$f^{-1}(a) = 1-b = 1-f(a)\\f^{-1}(b) = a = 1-f(b)\\f^{-1}(1-a) = b = 1-f(1-a)\\f^{-1}(1-b) = 1-a = 1-f(1-b)$
As user582578 points out, we can partition $\mathbb{R} \backslash \{ \frac{1}{2} \}$ into pairs $\{a,1-a\}$, combine these pairs into pairs of pairs $\{ \{a, 1-a\}, \{b, 1-b\}\}$ and then use this construction to define $f$ on the four values in each pair of pairs. We then just add the special case $f(\frac{1}{2}) = \frac{1}{2}$ to complete the definition of a $f$ for which $f^{-1}=1-f$.
A: I offer a proof that $f$ cannot be a real polynomial... 
Putting $f(x)$ back into $f^{-1}(x)=1-f(x)$ gets:
$$f^{-1}(f(x))=1-f(f(x))
\\ \implies x=1-f(f(x))
\\ \implies f(f(x))=1-x$$
Suppose that $f(x)$ was a polynomial of degree $n$. Then $f(f(x))$ has degree $n^2$. 
$f(f(x))=1-x$ then gives us that $n^2=1$ and so $n=1$. 
So $f(x)$ must be linear and we can write $f(x)=ax+b$ for some $a,b \in \mathbb{R}$ and:
$$ f(f(x))=a(ax+b)+b=a^2x+ab+b$$
Equating this to $1-x$ gives:
$$ \left\{ \begin{array} \\ a^2=-1 \\ ab+b=1 \end{array} \right. $$
$$ \implies \left\{ \begin{array} \\ a=i \\ b=\frac{1}{2}(1-i) \end{array} \right. $$
... which is obviously not real.
It does nicely give $f(x)=ix+\frac{1}{2}(1-i)$ as a function that works on $\mathbb{C}$ though!
