(Solution by I. Voronovich.) Rewrite the given equation as
f(f(m)+n)=f(n)−f(m)+f(3m)+c,(1)
where c=2014; all we need in this solution is that c is even and coprime with 3. Let f(0)=a.
1) Setting m=0 we get f(n+a)=f(n)+c, then by standard induction to both sides f(n+ka)=f(n)+kc, k∈Z; in particular, f(ka)=a+kc and f(a)=a+c.
2) Set m=n in (1), then
f(n)+n=f(3n)+c=[in view of 1]=f(3n+a).
3) Setting m=a in (1) we get
f(n+f(a))=f(n)−f(a)+f(3a)+c,
or, in view of 1) f(n+c)+c=f(n+c+a)=f(n)−c−a+a+3c+c, or f(n+c)=f(n)+2c. Again, by easy induction f(n+kc)=f(n)+2kc.
4) Searching on injectivity: suppose that f(s)=f(t). Then setting m=s and m=t in (1) we obtain f(3s)=f(3t), and thus f(3ls)=f(3lt) for all l∈N. Since (3;c)=1, there exists an l such that 3l−1=nc for some n∈N. Then in view of 3) we have
f(3ls)=f(3lt)⟺f(s+(3l−1)s)=f(t+(3l−1)t),
or f(s+nsc)=f(t+ntc), or f(s)+2nsc=f(t)+2ntc, 2nsc=2ntc, so s=t. Thus f is injective. Since in view of 2) f(f(n)+n)=f(3n+a), we obtain f(n)+n=3n+a, f(n)=2n+a. Easy verification shows that the function is a solution of (1) if and only if a=c/2.