A function receives as input an element of some set A and returns as output an element of some set B. We say f maps A to B. (A is the domain and B is the codomain.)

For example, consider a function f that takes any real number and returns 0. This function maps to {0}.

Common notation is

We can also use the word map for individual elements. Thus, for the above function we have f maps 3 to 0, f maps 6.5 to 0, etc.

Input/output is a common computer science analogy; the usual way to define a function is by way of a subset of the Cartesian product with every element of A paired with (mapped to) exactly one element of B.