You've used functions your whole life — at a vending machine, on a calculator, even when converting currencies. Here's what makes a function a function, explained visually and without the jargon.
In mathematics, a function is a rule that takes an input and produces exactly one output. That's the entire idea, and everything else — domain, range, notation, graphs — is just a way of describing or checking that one simple promise: one input, one output.
Input → Output
A function is a rule that assigns exactly one output to every valid input.
The Full Picture
The domain is all possible inputs; the range is all possible outputs.
Vertical Line
If a vertical line crosses a graph twice, it's not a function.
What Makes Something a Function?
THE ONE-OUTPUT RULEA function is a special kind of relationship between two sets of numbers. For every input you choose, the function gives you exactly one output. Not zero, not two — exactly one.
Think of a vending machine. You press B4 (the input), and you get exactly one snack (the output). Press B4 again, you get the same snack. That's a function. Now imagine a machine where pressing B4 sometimes gives you chips and sometimes gives you a soda — that's not a function, because one input produced two different outputs.
A function is a rule that maps each input to exactly one output. The set of all valid inputs is called the domain, and the set of all resulting outputs is called the range.
Functions vs. relations
A relation is any set of ordered pairs — it's a looser idea. A function is a relation with a strict condition: no input can be repeated with different outputs. Every function is a relation, but not every relation is a function.
| Input (x) | Output (y) — Relation A | Output (y) — Relation B |
|---|---|---|
| 1 | 3 | 3 |
| 2 | 5 | 5 |
| 3 | 7 | 7 or 9 |
| 4 | 9 | 11 |
Relation A is a function — every input maps to one output. Relation B is not a function, because input 3 produces two possible outputs. The vertical line test on a graph is just a visual way of checking this same rule.
Domain and Range: The Full Description
INPUTS AND OUTPUTSThe domain is the complete set of inputs a function is allowed to accept. The range is the complete set of outputs it actually produces. Together, they tell you everything about what a function can and cannot do.
Here's a real example. For the function f(x) = 1 / x:
- The domain is all real numbers except 0 — because dividing by zero is undefined.
- The range is all real numbers except 0 — because 1 divided by any non-zero number is never exactly 0.
- If you graph it, the curve never touches the x-axis or y-axis — those missing values are exactly the ones excluded from domain and range.
Function Notation: What Does f(x) Mean?
READING THE SYMBOLSWhen you see f(x), it does not mean f multiplied by x. It means "the output of function f when the input is x." The letter f is just a name — you could call it g, h, or anything else.
This notation is powerful because it lets you evaluate a function at any input, compose functions, and describe behavior compactly. For example, f(2) means "plug 2 into the rule and see what comes out."
The Vertical Line Test: A Visual Check
GRAPH → FUNCTION?If you draw a graph on the coordinate plane, the vertical line test tells you whether it represents a function. The rule is simple: if any vertical line crosses the graph more than once, it is not a function.
Why does this work? Because a vertical line represents a single x-value. If it hits the graph twice, that one input has two outputs — breaking the core rule of functions.
A straight line that isn't vertical passes the test → it's a function. A circle fails the test → not a function, because most x-values inside the circle hit two y-values.
Functions in the Real World
Functions aren't abstract — they're everywhere you look, and recognizing them makes the math feel natural.
- Temperature conversion: Celsius to Fahrenheit is a function — one Celsius value always gives one Fahrenheit value.
- Currency exchange: Convert dollars to euros at a fixed rate — one input, one output.
- Vending machine: Press a code, get one specific item.
- Tax brackets: Your income determines your tax owed — a function of income.
- Speedometer: Your car's speed at a given moment is a function of time.
Mapping Diagrams: Seeing Functions Clearly
A mapping diagram shows two sets side by side — the domain on the left, the range on the right — with arrows connecting each input to its output. It's one of the clearest ways to see whether a relation is a function.
Functions vs. Non-Functions at a Glance
| Feature | Function | Not a Function |
|---|---|---|
| Input rule | Every input has exactly one output | At least one input has multiple outputs |
| Vertical line test | Passes — no vertical line hits twice | Fails — some vertical line hits twice |
| Mapping diagram | One arrow per input | Two or more arrows from one input |
| Example | y = x² | x = y² (opens sideways) |
Why Functions Matter
Functions are the building blocks of algebra, calculus, computer science, and almost every quantitative field. They let us describe relationships precisely, predict outputs from inputs, and build models of the real world. Once you see a function as a rule that assigns exactly one output to each input, everything else — graphs, notation, domain, range — falls into place.
A function is a rule that gives exactly one output for every valid input — and the vertical line test is how you check that visually.