Since f is strictly increasing, we have f(n)≥n for all n in S.
Assume that there exists an integer n in S such that f(n)>n. Let n0 be the smallest such n and write f(n0)=n0+k0, for some positive integer k0≥1. Again, since f is strictly increasing, we have f(n)≥n+k0, for all integers n≥n0.
Because k0≥1, we have
f(n0+k0)≥n0+2k0.
On the other hand, we have
f(n0+k0)=f(f(n0))≤2f(n0)−n0=n0+2k0
We deduce that
f(n0+k0)=n0+2k0
Because f(n0)=n0+k0, f(n0+k0)=(n0+k0)+k0 and f is strictly increasing, we deduce that f(n)=n+k0, for all n0≤n≤n0+k0.
We prove by induction on m that for all integer n such that
n0+mk0≤n≤n0+(m+1)k0
we have f(n)=n+k0. Hence
f(n)={n+k0n if n≥n0 otherwise
Conversely, if f is such a function and n≥n0 then
n+f(f(n))=n+f(n+k0)=2n+2k0=2f(n)
And if f(n)=n, the inequality is clearly satisfied.
Therefore, the solutions to this functional inequality are the functions that can be written as
f(n)={n+k0n if n≥n0 otherwise
for some n0∈S and some nonnegative integer k0≥0.