What is High School / Foundations

a Function?

The fundamental building block of all mathematics — a rule that assigns exactly one output to every input.

A function is a rule that takes an input, does something to it, and produces exactly one output. Think of it as a machine: you put something in, you get something out — and every time you put the same thing in, you get the same thing out.

The critical word is "exactly one." An input cannot produce two different outputs — that would break the rule. But two different inputs can produce the same output (that's fine).

Functions are everywhere: the square root of a number, the price of a product as a function of quantity, the position of a car as a function of time.

Input
x
Function
f(x) = x²
Output
🏧
The vending machine model

Press button A3 → you always get the same snack. That's a function. Now imagine a broken machine where pressing A3 sometimes gives chips, sometimes gives nothing, sometimes gives two things. That's not a function. Consistency and uniqueness of output are everything.

The vertical line test

Draw the graph of any relation. If any vertical line crosses the graph more than once, it's not a function — because one x-value would map to multiple y-values. If every vertical line hits the graph at most once, it passes the test and is a function.

A function \(f\) from a set \(A\) to a set \(B\), written \(f: A \to B\), is a relation such that:

Set-theoretic definition
$$\forall\, x \in A,\quad \exists!\, y \in B \text{ such that } f(x) = y$$

The symbol \(\exists!\) means "there exists exactly one." Set \(A\) is the domain (all valid inputs) and set \(B\) is the codomain (where outputs live). The set of actual outputs is called the range.

Linear
\(f(x) = mx + b\)
Constant rate of change. Produces a straight line. Slope is \(m\), y-intercept is \(b\).
Quadratic
\(f(x) = ax^2 + bx + c\)
Degree 2. Produces a parabola. Opens up if \(a > 0\), down if \(a < 0\).
Exponential
\(f(x) = a^x\)
Grows (or decays) multiplicatively. Models population, interest, radioactive decay.
Trigonometric
\(f(x) = \sin(x),\,\cos(x)\)
Periodic oscillating functions. Period \(2\pi\). Used in waves, circles, physics.
Piecewise
Different rules per interval
Uses different formulas depending on the value of \(x\). Common in real-world modelling.
Inverse
\(f^{-1}(x)\)
Undoes what \(f\) does. Exists only if \(f\) is one-to-one. Reflects the graph across \(y = x\).
Notation\(f(x)\) — "f of x", the output when input is \(x\)
Composition\((f \circ g)(x) = f(g(x))\) — apply \(g\) first, then \(f\)
Inverse\(f(f^{-1}(x)) = x\) — inverse undoes the function
Even function\(f(-x) = f(x)\) — symmetric about the y-axis
Odd function\(f(-x) = -f(x)\) — symmetric about the origin
One-to-oneDifferent inputs always give different outputs — passes horizontal line test
Example 1 — Evaluating
\(f(x) = 2x^2 - 3\)
Find \(f(4)\):
\(f(4) = 2(16) - 3 = 29\)
Example 2 — Composition
\(f(x)=x^2,\ g(x)=x+1\)
\((f \circ g)(x) = f(g(x))\)
\(= (x+1)^2 = x^2+2x+1\)
Example 3 — Inverse
\(f(x) = 3x + 6\)
Swap \(x\) and \(y\), solve for \(y\):
\(f^{-1}(x) = \dfrac{x-6}{3}\)
Example 4 — Not a function
\(x^2 + y^2 = 1\)
A circle. For \(x=0\), \(y=\pm 1\) — two outputs for one input. Fails the vertical line test.
✗ Confusing f(x) with f times x
\(f(x)\) means "f evaluated at x" — it is not multiplication. Writing \(f(x+2) = f(x) + 2\) is incorrect; you must substitute \(x+2\) into the entire expression for \(f\).
✗ Thinking every curve is a function
A circle, an ellipse, or any curve that loops back on itself is not a function of \(x\). Always apply the vertical line test when in doubt.
✗ Inverting without checking one-to-one
\(f(x) = x^2\) has no inverse on all of \(\mathbb{R}\) because \(f(2) = f(-2) = 4\). You must restrict the domain (e.g. \(x \geq 0\)) before the inverse \(f^{-1}(x) = \sqrt{x}\) is well-defined.

Ready to test your knowledge?

Functions appear in every quiz on BUders. Start with High School foundations.

Browse All Quizzes →