The question I am working on is this... Give an example of a surjective function from $\mathbb Z \to \mathbb Z$ that is not injective.
My question is simple, when it is worded as above, (which I can't seem to get a straight answer on from others) am I able to put restrictions on this, as an example, only use the positive integers with the formula I create to prove that my formula is surjective? To me, I see this as looking at the infinite set of integers and proving that the infinite set of integers applies to whatever my formula is and that I must prove based on that set of infinite integers that the function I create is surjective.
So where am I misunderstanding...someone told me as a hint that I should think about piecewise functions.
Comprehension of surjective and injective I got, just the wording of the question throws me off. Don't want answer, just trying to get a clue.