function
Think of a function as a reliable machine: you feed it an input, and it hands back exactly one output. Put in 3, get back the same answer every single time. The defining promise is that promise of singleness — one input never produces two different answers. A vending machine that gave you a soda one day and chips the next for the same button would not be a function.
Formally, a function f from a set A to a set B assigns to each element of A exactly one element of B. We write f: A → B. The key word is exactly one: every allowable input must have an output, and it must have only one. Many different inputs may share the same output (that is fine), but a single input may never split into two outputs.
Functions are the central objects of algebra and all of higher mathematics. Once you can describe how one quantity depends on another — distance on time, cost on quantity, area on side length — you have a function, and the whole machinery of graphs, transformations, and inverses becomes available to study it.
f(x) = 2x + 1 sends 0 → 1, 1 → 3, 2 → 5. Each input lands on exactly one output.
A linear function as an input-output machine.
Not every rule is a function. The rule “y is a number whose square is x” fails, because x = 4 would give both y = 2 and y = -2 — two outputs for one input.