Thank you, Steven, that was an oversight on my part.
Suppose
n is even. By definition, there exists some
k∈Z such that
n=2k. Therefore,
f(n)=k for some integer
k. Hence,
f(n) will generate all integers
k when
n is even.
Now suppose
n is odd. By definition, there exists some
m∈Z such that
n=2m+1. Thus,
f(n)=m+1. Since the integers are closed under addition,
f(n) will generate a subset of the integers when
n is odd.
In either case
f(n) will generate the union of
Z with a subset of the integers. But the union of
Z with a subset of
Z is equal to
Z. Therefore
f(Z)=Z.