The correct option is B {(2,7),(6,5),(1,8),(3,13),(4,12)}
For a relation to be a function every element of set B should have it's image in set A and an element of set B must have only one image in set A.
From the given options :
{(2,7),(6,5),(2,8),(3,13),(4,12)} has (2,7) and (2,8).
{(2,7),(6,5),(5,13),(3,13),(4,12)} has (5,13) and (3,13)
{(1,7),(2,8),(3,4)(5,13),(3,13),(4,12)} has (3,4) and (3,13)
{(2,7),(6,5),(1,8),(3,13),(4,12)} has all elements unique and every element in set B is mapped to only 1 unique element in set A. Hence it can represent a function.