For the consumer loyalty example, the x-variable is consumer loyalty and the y-variable is the chance that they repeat purchase. The domain of the function that relates loyalty to chance of a repeat purchase is the interval [0,1] because that's how loyalty was defined, and the range of the function is again [0,1] but this time because it is a probability.
We can consider a function as depicted by the following diagram; an input goes in, the rule is in the box, and the output comes out. Pictorially it would look like this:
One of the benefits of thinking mathematically is that it provides a concise shorthand notation: in particular we represent a function in the form y = f(x).
Here, y is the output variable, x is the input variable and the rule is denoted simply by the letter f. In English, the expression y = f(x), can be translated as
The function f, takes an input variable, x, and produces an output variable, y.
For the marketing example described previously, the input is loyalty, the output is propensity to repeat purchase, and the function f describes how propensity depends on loyalty.