A function is a relation from a set A (domain) to a set B (co-domain) such that every element of A is mapped to exactly one element of B.
Functions are one-to-one or many-to-one, but not one-to-many.
This tool visualizes mappings and checks if a relation is a function.