There is a definition which a pairing between to sets has to satisfy in order to be a function. It is like a checklist, we can go over it and tick each box to see if something is a function.
First rule is: if F (a pairing, the "thing" we try to decide if a funciton or not) takes elements from the set A and assigns them to an element in B then every element in A must be assigned to something from B by F. Second rule is: an element "a" in A must have a unique pair in B i.e. F cannot assign "a" to several elements in B. Checking these two rules is enough to decide if something is a function as anything that satisfies them is a function by definition.