(i) f = {(x, y) : x is a person, y is the mother of x}
As, for each element x in domain set, there is a unique related element y in co-domain set.
So, f is the function.
Injection test:
As, y can be mother of two or more persons
So, f is not injective.
Surjection test:
For every mother y defined by (x, y), there exists a person x for whom y is mother.
So, f is surjective.
Therefore, f is surjective function.
(ii) g = {(a, b) : a is a person, b is an ancestor of a}
Since, the ordered map (a, b) does not map 'a' - a person to a living person.
So, g is not a function.