Wow. I remember that I thought exactly this 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, where φ=(1+√5)/2 is the golden ratio.