A function is defined as a subset of the cartesian product such that, each element of the first set (object) is related to only one element in the second set (image).
Consider option (a).
This is not a function because the element 'y' is related to two elements instead of one.
Consider option (b).
This can be considered a function as it satisfies the necessary condition to be a function as per the definition. Note that it is possible for multiple objects to have the same image, but no object can possess more than one image.
Thus, only option (b) is a function here.