Given two sets X and Y, a function f: X --> Y is something that associates
with every element of X an element of Y. A
partial function is similar, but need not be defined for every element of X. Some textbooks call non-partial functions
total functions. The set X is called f's
domain; Y, its
codomain or
range.
A function can be considered to be a special kind of relation, namely, one in which no two pairs have the same first element.
Some mathematicians make a point of not defining functions in terms of set theoretic constructs; this happens, for instance, in category theory, where functions are the primitive notion, and sets + relations are defined in terms of them.
A function is surjective (or 'onto') if it covers all of its range; it is injective (or 'one to one') if it maps no two elements to the same value. A bijective function is both surjective and injective: it has an inverse function.