Wow. I remember that I thought exactly thisthe same problem out of curiosity as a high school student but did not reach an answer. In fact, I was thinking about posting this problem on MathOverflow!
At least it is easy to construct one solution: f(x)=xφ/φφ+1φ−1, where φ=(1+√5)/2 is the golden ratio.
Edit: Corrected the calculation. Thanks to Aaron Meyerowitz for spotting the error!