The condition for a group of paired values to be a function is that for each value of the independent variable exists one and only one value of the dependant variable.
In this case, A is the group of points that represent the independent variable, and B, the dependent variable.
As each value of A has one and only one value of B, f is a function from A to B.
The inverse is not true, as 6 would have 2 values (a and c) in the image (A).
A is the domain of the independent variable.
f is the function that transform the values present in the group A in some of the elements of the image, that is group B.
The conditions for that relation to be a function is that each of the values in the domain has one and only one value in the image.