Give an example of a function from N to N that is one to one but not onto
My answer is the function from {a,b,c} to {1,2,3,4} with f(a) = 3, f(b) = 4, f(c) = 1. Is this the correct example to this question? What does it mean from N to N?
No it is not correct.
First N is the set of counting numbers either {0,1,2,3,...} or {1,2,3,4,...} (i.e. it contains 0 or not depending on your textbook). So N is infinite; so your example must be infinite also. Here is another example in addition to the one given above.
Note if is a finite set it is NOT POSSIBLE to find:
that is one-to-one but not onto. This is a consequence of the Pigeonhole Principle. This is a distinction between finite and infinite sets.
Look! We do not know what textbook or set of notes you are following.
Sorry to say, but it is true nonetheless, there are no hard and fast definition in mathematics. So you read the definition of in your text material. Most texts that I have seen require to be either {0,1,2,3,…} or {1,2,3,…}*. So yes the customary and usual definitions of mean that the set is made of non-negative integers.
* See this site: Counting Number -- from Wolfram MathWorld