A function is a special type of relation that maps each element of one set to an element of another set, such that each element of the first set is mapped to exactly one element of the second set.