A function is a rule that takes an input value and turns it into exactly one output value. Think of it as a machine: you put a number in, the machine applies its rule, and a single number comes out. For example, the rule double the number and add 1 turns an input of 4 into an output of 9, because 2 times 4 plus 1 is 9. We write this function as f(x) equals 2x plus 1, where f(x) means the output when the input is x. The input is called the domain and the output is called the range. The key rule is that each input has exactly one output, so a function can never send one input to two different answers.
Function notation lets us find outputs quickly. If f(x) equals x squared minus 3, then f(4) means put 4 in place of x, giving 16 minus 3, which is 13. Similarly, f(0) is 0 minus 3, which is minus 3, and f(minus 2) is 4 minus 3, which is 1. Notice that f(2) and f(minus 2) are both 1, and that is allowed, because the rule is one output per input, not one input per output. We can also work backwards: to find x when f(x) equals 13 for f(x) equals 2x plus 1, solve 2x plus 1 equals 13 to get x equals 6. Composite functions apply one function after another. If f(x) equals x plus 2 and g(x) equals 3x, then fg(4) means apply g first to get 12, then f to get 14.
A function can be shown as a table of values or as a graph, and each view tells us something useful. The graph of f(x) equals 2x plus 1 is a straight line with gradient 2 and intercept 1, while the graph of f(x) equals x squared is a curve called a parabola. To test whether a graph shows a function, use the vertical line test: if any vertical line crosses the graph more than once, one input has more than one output, so it is not a function. A circle fails this test, but a parabola passes it. Functions model real life everywhere: the cost of a taxi ride as a function of distance, the height of a ball as a function of time, and temperature as a function of the hour of the day.