1. Initial Observation: We need to determine all surjective functions f:N→N such that for any sum-free subset A⊆N, the image {f(a)∣a∈A} is also sum-free.
2. Identity Function: The function f(x)=x is a candidate. If A is sum-free, then {f(a)∣a∈A}=A is also sum-free. We need to show that this is the only function that satisfies the condition.
3. Claim 1: For all x∈N, f(2x)=2f(x). If f(y)=2f(x), then y=2x.
Proof: Suppose f(x)=c. Since f is surjective, there exists y such that f(y)=2f(x)=2c. Thus, f(x)+f(x)=f(y). If {x,y} is sum-free, then {f(a)∣a∈{x,y}} must be sum-free, but f(x)+f(x)=f(y) contradicts this. Therefore, y=2x or 2x=y. Assume y=2x. Then f(2x)=2c. By surjectivity, there exists y1 such that f(y1)=4c=2f(2x). By the same logic, y1∈{2⋅2x,22x}={x,4x}. Since y1=x, y1=4x. Continuing this process, we get a sequence yk such that f(yk)=2k+1c and yk=2kx. This is impossible since ν2(x) is finite. Thus, y=2x and f(2x)=2f(x).
4. Claim 2: Let {ci}i≥1 be a sequence of naturals such that f(ci)=i for all i≥1. Then ci=ic1 for all i≥1.
Proof: The ci are pairwise distinct since if ci=cj, then i=f(ci)=f(cj)=j. We use induction on i. For i=1, the result is trivially true. For i=2, by Claim 1, f(c2)=2=2f(c1), so c2=2c1. For i=3, f(c3)+f(c1)=f(c4), and from Claim 1, f(c4)=2f(c2), so c4=2c2=4c1. Thus, {c1,c3,c4}={c1,c3,4c1} is not sum-free. Since {c1,4c1} is sum-free, c3∈{2c1,2c1,24c1,2(4c1),4c1−c1,4c1+c1}={21c1,2c1,3c1,5c1,8c1}. If c3=21c1, then f(c1)=f(2c3)=2f(c3)=6, absurd. If c3=2c1, then f(c3)=f(2c1)=2f(c1)=2, absurd. If c3=8c1, then f(c3)=f(8c1)=2f(4c1)=4f(2c1)=8f(c1)=8, absurd. Thus, c3∈{3c1,5c1}. If c3=5c1, then f(c5)=f(c1)+f(c4)=f(c1)+f(4c1), so {c1,4c1,c5} is not sum-free. Thus, c5∈{2c1,2c1,24c1,2(4c1),4c1−c1,4c1+c1}={21c1,2c1,3c1,5c1,8c1}. If c5=21c1, then f(c1)=f(2c5)=2f(c5)=10, absurd. If c5=2c1, then f(c5)=f(2c1)=2f(c1)=2, absurd. If c5=8c1, then f(c5)=f(8c1)=8f(c1)=8, absurd. Thus, c5∈{3c1,5c1}. c5 cannot be 5c1 since we are assuming for the sake of contradiction that c3=5c1, and we know c3=c5. Thus, c5=3c1. Now, since c3=5c1, it follows that c6=2c3=10c1 by Claim 1, so f(c1)+f(c5)=f(c1)+f(3c1)=f(10c1)=f(c6), but {c1,3c1,10c1} is sum-free, a contradiction. Thus, c3=3c1.
Now, assume that for some k≥3, we have that for all 1≤i≤k that ci=ic1. Then, f(ck+1)=f(c1)+f(ck)=f(c1)+f(kc1), so {c1,kc1,ck+1} is not sum-free. Since k≥3, {c1,kc1} is sum-free, so ck+1∈{2c1,2c1,2kc1,2kc1,kc1−c1,kc1+c1}={21c1,2c1,2kc1,(k−1)c1,(k+1)c1,2kc1}. If ck+1=21c1, then f(c1)=f(2ck+1)=2f(ck+1)=2k+2, absurd. If ck+1=2c1, then f(ck+1)=f(2c1)=2f(c1)=2, absurd. If ck+1=2kc1, then k=f(ck)=f(kc1)=f(2ck+1)=2f(ck+1)=2k+2, absurd. If ck+1=2kc1, then f(ck+1)=f(2kc1)=2f(kc1)=2f(ck)=2k, absurd. If ck+1=(k−1)c1, ck+1=(k−1)c1=ck−1, absurd. Thus, ck+1=(k+1)c1, as desired, so our inductive step is complete and so we are done.
5. Conclusion: Since f is surjective, there exists such a sequence {ci}, so fix such a sequence. If there existed a d1=c1 for which f(d1)=1, then d1,c2,c3,⋯ is also a valid sequence, so c2=2d1. But c2=2c1, so c1=d1, a contradiction. So f is injective at 1. Now, f is injective at any j>1 since if there existed a dj=cj for which f(dj)=j, then c1,c2,⋯,cj−1,dj,cj+1,⋯ is also a valid sequence, so dj=jc1. But cj=jc1 as well, so cj=dj, a contradiction. Thus, f is bijective, so there exists an i for which ci=1. Then, 1=ic1, so i∣1, implying i=1. Thus, c1=1, so ci=i, and so f(i)=i for all i≥1, as desired.
■
The final answer is f(x)=x