TITLE: How to find $\int_0^1f(x)dx$ if $f(f(x))=1-x$?
QUESTION [15 upvotes]: A friend of mine gave this question to me : 
Find the value of $\int_0^1f(x)dx$ if $f$ is a real, non-constant, differentiable function satisfying $$f(f(x))=1-x  \space\space\space\space\space\space\forall x\in(0,1)$$ 
The only thing that came to my mind was to form a differential equation with the given equation and find a solution but that was a dead end. If someone could give me a hint on how to tackle this problem it would be great. 
EDIT: All this time wonghang and John Ma's answers had me convinced that this problem was not well thought-out. But like Sanket has pointed out, if we disregard the differentiable assumption for a while, does there now exist an $f$ satisfying the given conditions? Can someone find an example? I tried to produce one using some variants of the absolute value function but to no avail.

REPLY [8 votes]: The given function is not possible, but if we assume the given function is not differentiable which should have been mentioned then answer would have been $\frac 12$.
$$f(f(x)) =1-x\implies f(1-x)=1-f(x)$$
$$\int_0^1 f(x)dx=1-\int_0^1f(1-x)dx=1-\int_0^1 f(x)dx\implies \int_0^1 f(x)dx=\frac 12$$