We shall prove that the identity is the unique function satisfying the conditions in the statement. Clearly, f(1)=1, so f(n)≥2 if n≥2, by injectivity. We will use the following well-known result.
Egyptian fractions theorem. For every positive rational r and positive integer n, there exists a finite set S of integers greater than n such that r=∑s∈S1/s.
Now, consider an integer n≥2 and use the Egyptian fractions theorem to write
1−n1=s∈S∑s1, where S is a finite set of integers greater than n(n+1), and
get thereby
1=n1+s∈S∑s1=n+11+n(n+1)1+s∈S∑s1.
Both are positive integers, so
f(n+1)1+f(n(n+1))1−f(n)1
is an integer. Since −21≤−f(n)1<f(n+1)1+f(n(n+1))1−f(n)1<f(n+1)1+f(n(n+1))1≤21+21=1, it follows that f(n)1=f(n+1)1+f(n(n+1))1. In particular, f is strictly increasing, so f(n)≥n.
Finally, proceed by induction on n≥2 to prove that f(n)=n. To show that f(2)=2, simply notice that 2/f(2)=1/f(2)+1/f(3)+1/f(6) is a positive integer not exceeding 1. To complete the proof, let f(n)=n for some n≥2 and write
n1=f(n)1=f(n+1)1+f(n(n+1))1≤n+11+n(n+1)1=n1
to conclude that f(n+1)=n+1.