A function f from a set A to a set B (written f:A→B) is a rule that associates to every element x∈A a unique element y∈B, written y=f(x). Two things can break this: an element of A left with no image at all, or an element of A given two different images — either failure means the relation is not a function.
A is called the domain (the full set of allowed inputs), B is the co-domain (the set outputs are guaranteed to land inside), and the range is the smaller set f(A)={y∈B∣y=f(x) for some x∈A} of values actually produced — always a subset of the co-domain, though it may equal it. A function can be shown in six equivalent ways: a verbal description, an arrow diagram between two sets, a set of ordered pairs, an algebraic rule/formula, a table of values, or a graph — with domain and range read off each form appropriately (e.g. on a graph, domain is the horizontal spread/projection onto the x-axis, and range the vertical spread/projection onto the y-axis). …