An example of an injective function R→R that is not surjective is h(x)=ex. This "hits" all of the positive reals, but misses zero and all of the negative reals. But the key point is the the definitions of injective and surjective depend almost completely on the choice of range and domain.