← Back to High School Math

Introduction to Functions

High School Math · Algebra 1Preview

1. Introduction

Functions are the single most important idea in all of high school mathematics, and they quietly power almost everything you will study afterward — calculus, statistics, physics, economics, and computer science. The reason is simple: a function is the mathematical word for a dependable relationship. Whenever one quantity is determined by another — the cost of gas depending on the number of gallons, the height of a thrown ball depending on time, the area of a circle depending on its radius — you are looking at a function.

Informally, a function is a machine. You feed it an input, it performs some fixed rule, and it returns exactly one output. The crucial words are exactly one: a function is never allowed to be indecisive. If you put the same input in twice, you must get the same output both times. This single restriction is what separates functions from arbitrary relations, and it is what makes them so useful for prediction.

In this article we build the concept from the ground up. We start with the intuition of inputs and outputs, formalize the definition, learn the universal language of function notation, and then study the two most important sets attached to any function: its domain (allowed inputs) and its range (resulting outputs). Along the way we learn to read graphs, apply the vertical line test, compose functions, perform arithmetic on outputs, and avoid the classic mistakes that trip up nearly every student the first time around. By the end you should be able to evaluate functions fluently, determine domains by inspection, and recognize functions in tables, graphs, equations, and words.

Functions are the language in which calculus, physics, and data science are written. Investing time now to make function notation second nature — especially domain, range, and composition — pays compound interest throughout your mathematical education.

2. Core Concepts

2.1 What a function really is

Picture a vending machine. You press B4 and out comes a specific snack. Press B4 again and you get the same snack. A vending machine that sometimes gave you chips and sometimes gave you gum for the same button would be broken — and that is exactly what a "broken" relation looks like in mathematics.

Formally, a function ff from a set XX to a set YY is a rule that assigns to each element xXx \in X exactly one element yYy \in Y. We call XX the domain and YY the codomain. The element assigned to xx is written f(x)f(x), read "ff of xx."

Two requirements are hidden in this definition:

  • Existence: every input in the domain must produce an output (no input is left unmatched).
  • Uniqueness: no input may produce two different outputs.

Uniqueness is the part people forget. The relation "yy is a number whose square is xx" is not a function of xx, because x=9x = 9 would give both y=3y = 3 and y=3y = -3. By contrast "yy is the non-negative square root of xx" is a function.

2.2 Relations versus functions

A relation is any pairing of inputs with outputs — it does not require uniqueness. Every function is a relation, but not every relation is a function. The set of all ordered pairs (x,y)(x, y) satisfying a rule is called the graph of the relation. A relation is a function exactly when no input xx appears with two different outputs yy.

2.3 Function notation and why we use it

The notation f(x)f(x) is one of the best inventions in mathematics because it does two jobs at once: it names the function (ff) and it names the input (xx). When we write

f(x)=2x+1,f(x) = 2x + 1,

we are giving the rule: "take the input, double it, and add one." The letter xx is a placeholder. We can replace it with any number or even another expression:

f(3)=2(3)+1=7,f(a+1)=2(a+1)+1=2a+3.f(3) = 2(3) + 1 = 7, \qquad f(a+1) = 2(a+1) + 1 = 2a + 3.

A common beginner error is to read f(x)f(x) as "ff times xx." It is not multiplication. It is the output of ff at xx. The parentheses here mean "evaluate," not "multiply."

We are free to use other letters. g(t)g(t), h(θ)h(\theta), and V(r)V(r) are all functions; the letter inside the parentheses just tells us what the input variable is called. Writing V(r)=43πr3V(r) = \tfrac{4}{3}\pi r^3 instantly signals that volume depends on radius.

2.4 Domain: the allowed inputs

The domain is the set of all inputs for which the rule produces a valid real-number output. Sometimes the domain is stated explicitly; more often you must infer it from the formula by asking: what inputs would break the arithmetic?

There are three classic "forbidden operations" to watch for in high school:

  • Division by zero. Any input that makes a denominator zero is excluded. For f(x)=1x2f(x) = \dfrac{1}{x-2}, the value x=2x = 2 is not allowed, so the domain is all real numbers except 22.
  • Even roots of negatives. A square root (or fourth root, etc.) requires a non-negative radicand. For g(x)=x5g(x) = \sqrt{x-5}, we need x50x - 5 \ge 0, so the domain is x5x \ge 5.
  • Logarithms of non-positive numbers: the argument must be strictly positive.

Odd roots, like x3\sqrt[3]{x}, accept every real number, since you can take the cube root of a negative.

2.5 Range: the resulting outputs

The range is the set of all outputs the function actually produces as the input runs over the entire domain. Range is usually harder to find than domain because it depends on the behavior of the rule, not just on forbidden operations.

For f(x)=x2f(x) = x^2, every output is a square, so the range is y0y \ge 0 even though the domain is all real numbers. For f(x)=2x+1f(x) = 2x + 1 (a line), every real number is hit exactly once, so the range is all real numbers. A reliable strategy is to think about the graph: the domain is the set of xx-values covered (horizontal shadow), and the range is the set of yy-values covered (vertical shadow).

2.6 Representations of a function

The same function can appear in four forms, and fluency means moving between them:

  • Verbal: "Output is one more than twice the input."
  • Algebraic: f(x)=2x+1f(x) = 2x + 1.
  • Numerical (table): input 010 \to 1, input 131 \to 3, input 252 \to 5.
  • Graphical: the straight line through those points.

These are four pictures of one object. A table is a function only if no input is listed twice with different outputs.

2.7 Mapping diagrams and arrow notation

A mapping diagram shows the domain on the left, the codomain on the right, and arrows from each input to its unique output. If any input has two arrows leaving it, the diagram does not represent a function. Arrow notation xf(x)x \mapsto f(x) means "the input xx is sent to the output f(x)f(x)." This picture is especially helpful when the domain is a small finite set, such as {1,2,3}\{1, 2, 3\}.

2.8 The vertical line test

A graph in the xyxy-plane represents yy as a function of xx exactly when no vertical line crosses the graph more than once. The reasoning is direct: a vertical line x=cx = c collects every point with input cc. If the line hits the graph twice, then the input cc has two outputs, violating uniqueness.

A parabola y=x2y = x^2 passes the test. A full circle x2+y2=25x^2 + y^2 = 25 fails it, because the line x=0x = 0 meets it at both (0,5)(0, 5) and (0,5)(0, -5). So a circle is a relation but not a function.

2.9 Function arithmetic

Given two functions ff and gg with overlapping domains, we can combine their outputs:

(f+g)(x)=f(x)+g(x),(fg)(x)=f(x)g(x),(f + g)(x) = f(x) + g(x), \qquad (f - g)(x) = f(x) - g(x), (fg)(x)=f(x)g(x),(fg)(x)=f(x)g(x),g(x)0.(fg)(x) = f(x)\,g(x), \qquad \left(\frac{f}{g}\right)(x) = \frac{f(x)}{g(x)}, \quad g(x) \neq 0.

The domain of each combined function is the intersection of the individual domains, with extra exclusions for division. For example, if f(x)=xf(x) = \sqrt{x} and g(x)=x4g(x) = x - 4, then (f+g)(x)=x+x4(f + g)(x) = \sqrt{x} + x - 4 has domain x0x \ge 0.

2.10 Composition of functions

Composition applies one function after another. The composition (fg)(x)(f \circ g)(x) means "apply gg first, then apply ff to the result":

(fg)(x)=f(g(x)).(f \circ g)(x) = f(g(x)).

Order matters: in general (fg)(x)(gf)(x)(f \circ g)(x) \neq (g \circ f)(x). The domain of fgf \circ g requires that xx be in the domain of gg and that g(x)g(x) be a legal input of ff.

2.11 Piecewise-defined functions

A piecewise function uses different formulas on different parts of the domain. The absolute value is the classic example:

x={x,x0x,x<0.|x| = \begin{cases} x, & x \ge 0 \\ -x, & x < 0. \end{cases}

Each piece must cover its region without overlap (except at boundaries, where the outputs must agree if the function is to be well-defined). Piecewise functions model real situations with different rules in different regimes — tax brackets, shipping rates, or speed limits.

2.12 Inverse functions (preview)

If ff sends aa to bb and never repeats an output, we can define an inverse function f1f^{-1} that sends bb back to aa. Formally, f1(f(x))=xf^{-1}(f(x)) = x for every xx in the domain of ff, and f(f1(y))=yf(f^{-1}(y)) = y for every yy in the range of ff. The notation f1f^{-1} does not mean 1f(x)\dfrac{1}{f(x)}; it means "undo ff." Linear functions f(x)=mx+bf(x) = mx + b with m0m \neq 0 always have inverses f1(y)=ybmf^{-1}(y) = \dfrac{y - b}{m}.

Continue reading with Premium

Upgrade to read the full article and unlock all Premium features.

Free

  • Unlimited practice — all difficulties
  • 3 hints / day
  • Community solutions
  • 2 timed mocks / month

Premium

  • Full article + all 57+ theory guides
  • Unlimited hints on practice problems
  • Unlimited timed mock exams & PDF worksheets
Log in