where the domain and codomain are the set of all real numbers
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
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.