The set for B does not represent a function because if plotted, the graph does not pass the vertical line test in which a vertical line is moved along the graph.
If there is more than one point along the vertical line, it is not a function.
A way to check if it passes the vertical line test without graphing it and actually doing the test is to make sure that all of the values for x are different.
If they are all different, it is a function and if they are not all different, then it is not a function.
Hope this helps!