Onto function with domain of natural numbers and co-domain of integers I'm trying to find an onto function f: $\mathbb{N}$ → $\mathbb{Z}$
This is a new concept I'm learning, and I'm not sure how this would be written. Just need one clear example so I can practice with other examples. Thanks.

take the function $f: \mathbb{N} \longrightarrow \mathbb{Z}$ to be $f(n)= -n/2$, when $n$ is even, and $(n + 1)/2$, when $n$ is odd.
