Let n be an arbitrary integer and
Sn={n−2015,n−2014,…,n,…,n+2015}
be the set of all integers that differ from n by at most 2015.
We know that Sf(n)={f(n)−2015,f(n)−2014,…,f(n)+2015}.
From the condition of the problem it follows that the numbers f(n−2015),f(n−2014),…,f(n+2015) are also elements of the set Sf(n), since they differ from f(n) by at most 2015. Because f is injective all these numbers are different. There are 4031 of them, which is also the size of the set Sf(n). Thus
Sf(n)={f(n)−2015,…,f(n)+2015}={f(n−2015),…,f(n+2015)}
Let us now look at the intersection of the sets Sf(n) and Sf(n+1). On one hand we have
Sf(n)∩Sf(n+1)={f(n−2015),…,f(n+2015)}∩{f(n−2014),…,f(n+2016)}={f(n−2014),…,f(n+2015)}.
So the intersection has 4030 elements. On the other hand we have
Sf(n)∩Sf(n+1)={f(n)−2015,…,f(n)+2015}∩{f(n+1)−2015,…,f(n+1)+2015}.
This set can have 4030 elements if and only if f(n) and f(n+1) differ by 1. Thus we proved that ∣f(n+1)−f(n)∣=1 for every integer n.
If for some n we have f(n+1)−f(n)=1 then by induction we have f(n+k)−f(n)=k for every integer k. Similarly, if for some n we have f(n+1)−f(n)=−1 then we have f(n+k)−f(n)=−k for every integer k. In both cases we get ∣f(m)−f(n)∣=∣m−n∣ for all integers m and n.