The range of a function is the actual values that the out put takes. Here is an example:

Define

where the domain and codomain are the set of all real numbers

by

The Range of this function is becuase there are no Real numbers that map to a negative value. Note that the Range is always a subset of the codomain.

So for part 1 we need to show that for every Integer there is a real number that maps to it

Notice that for any Integer N So this is in the domain of the function.

Now for part 2

Note that the domain and codomin are the integers

Suppose now that the function is surjective then

Solving for x gives

but this gives a contadiction because

i.e here is a specific counter example

claim:

If it is then

for some integer x

solving we get

but this is not an integer and the function is not onto because is not in the domain.