For some function $f: Z \rightarrow Z^{+}$
Is $f(x) = x^2$ a function that maps all integers to all positive integers?
According to my textbook, it is, but I am unsure because for $x=0$, $f(0) = 0$ which is not in the target $Z^{+}$. So does that mean it is not a function of $f: Z \rightarrow Z^{+}$?
Textbook:
Find a function whose domain is the set of all integers and whose target is the set of all positive integers that satisfies each set of properties.
(a) Neither one-to-one, nor onto.
Solution: $f(n) = n^2$