4. Recall that a function f is onto if, and only if, for every element y in the
co-domain, there exists an element x in the domain such that f(x) = y.
A function f is not onto if, and only if, there exists an element y in the co-domain such
that for all elements x in the domain, f(x) is not equal to y.
Define the functions F: RR+ È
{0} and G: Z
Z by F(x) = x2 for all x
in R and G(x) = x2 for all x in Z.
The function F is onto. Suppose that y is an element in R+ È {0}. Then there does exist an element x in R such that F(x) = y, namely x is the square root of y.
The function G is not onto since there exists an integer y, say y = 2, such that you can never find another integer x for which G(x) = x2 = 2.