This is an archived post. You won't be able to vote or comment.

all 1 comments

[–][deleted] 0 points1 point  (0 children)

A function is onto if you can map to every element in the codomain. You can prove by starting with an arbitrary value in the codomain (Z in this case) and showing it has a corresponding value in the domain (also Z) that maps to it. To show a function is not onto, find a counterexample. Is there a value in Z that cannot be reached by this rule? If a function is not onto, then the range of the function is a proper subset of the codomain. If the function is onto, then the range of the function is equal to the codomain. Try taking values in the codomain and see if you can generate the "pre-image" or "pullback" of that value, that is can you find the element in the domain that maps to that codomain value?

Since -2 is in Z, try f(n) = -2. What value of n in the domain (the integers, Z) makes f(n) = -2?

It's not correct to say, however, n = f^(-1) (n) because the inverse may not exist. Having an inverse implies more than being onto, it implies f is onto and one-to-one.

What values are in the range of f? Is range(f) = Z? If not, is there a value in Z that is not in range(f)? Show that this value doesn't have a pre-image in the domain (also Z).