What is the Definition of a Math Function?

The definition of a math function is a rule that assigns to each value of one variable a single value of another variable. For example f(x): 1 2 3 4 the function is x and the domain is 1 2 3 4.