Every function is a relation, but most relations are not functions. The sections below show how to test that rule on pairs, tables, equations and graphs, how to read the domain and range, and what happens when a relation is reversed.
What are relations and functions, exactly?

A relation only records which inputs are linked to which outputs. Students and their heights, cities and their zip codes, and the pairs are all relations. A function adds one rule, and the rule has a direction: reading from input to output, nothing branches.
In words, if the same input shows up twice, the outputs must match. A vending machine is a good picture: pressing B4 always returns the same snack, though two different buttons may return the same snack.
A repeated output, such as and , is fine. Only a repeated input with different outputs, such as and , breaks the rule.
Direction matters more than most lessons admit. The relation is a function with depending on , yet reversed it becomes , where one input has three outputs. So the honest question is never “is this a function?” but “is a function of ?”
How do you tell if a relation is a function?

Look only at the inputs, the first coordinates. A repeated input matters only when the outputs attached to it differ. In a table, read down the column. In a mapping diagram, every element on the left needs exactly one arrow leaving it. Several arrows may arrive at the same element on the right, but two arrows leaving one element on the left fail the test. An element with no arrow at all means the diagram is not a function on that whole set, although removing that element from the domain would repair it.
Example 1. Decide whether each relation is a function.
For , the pair is written twice, but a set counts it once. The distinct pairs are , with inputs , each used once. The output repeats, which is allowed. So is a function.
For , the input is paired with both and . That single conflict is enough, so is not a function.
A fast mental check for long lists: count the distinct pairs and the distinct inputs. If there are more distinct pairs than distinct inputs, some input is carrying two outputs, and the relation fails. Here has pairs and inputs, while has pairs and only inputs.
Quick check
Answer:
Does an equation define y as a function of x?
Solve for and watch for a plus-or-minus sign. A that comes from an even root, or an absolute value such as , signals two outputs for one input. An odd root never causes this, because every real number has exactly one real cube root.
Example 2. Does define as a function of ? What about ?
Test one input in the first equation. At the equation reads , so or . One input, two outputs, so it is not a function. Solving in general gives the same signal:
For , each gives one real cube root:
That is one output per input, so it is a function.
The two directions are not symmetric. One failing input proves an equation is not a function, but one passing input proves nothing, so a “yes” needs an argument for every , such as having solved for cleanly. Notice too that is not a function of , yet is a function of there, which is the direction point from earlier.
Try this: In , count how many -values you get for , and . One of them gives a single value. Why does that not rescue the equation?
How does the vertical line test work?
Every point on a vertical line shares the same -value. If such a line touches the graph twice, two different -values sit above one input, which is exactly the violation. That is the whole idea behind the vertical line test, and it is why the test is a restatement of the definition rather than a separate rule.
Two cases catch students. At a jump discontinuity, a vertical line through the jump hits the filled dot but misses the open circle, so the graph still passes. And a graph that looks like a function over the window you can see may curl back outside it, so the test applies to the entire graph.
A horizontal line test asks a different question: can an output be reached from two inputs? Failing it does not stop a graph from being a function. It only means the function is not one-to-one, which matters for inverses. The four mapping types sort out like this:
| Mapping | Example | Function? | One-to-one? |
|---|---|---|---|
| One-to-one | Yes | Yes | |
| Many-to-one | Yes | No | |
| One-to-many | No | No | |
| Many-to-many | No | No |
How do you find the domain and range of a relation?
The domain is the set of inputs and the range is the set of outputs. For a list of pairs, write the first coordinates and the second coordinates, listing each value once. For an equation, the domain starts as all real numbers and domain and range work then removes whatever breaks the formula. Three things usually do:
- a denominator that equals zero
- an even root of a negative number
- a logarithm of zero or a negative number
Finding the range means asking what the smallest and largest outputs are and whether everything between them occurs. For , the root needs , and a root is never negative:
So the domain is and the range is . A shortcut confirms it: this is the parent root curve shifted right and up (see transformations of functions), so its starting corner is , and the graph runs right and up from there. At the corner, , and at the value is .
A vocabulary trap: the range is the set of outputs actually produced, while the codomain is the set the outputs are allowed to land in. For on the real numbers, the codomain is all reals but the range is only . Some courses use “range” for the codomain, so check which meaning your textbook intends.
Quick check
Answer: All real numbers except
What does function notation f(x) tell you?
The symbol reads “f of x” and means the output of the function at input . It is not times . It replaces the variable and also tells you which function is being used, which matters once several functions appear in one problem. The full conventions are in function notation.
Example 3. Let . Find and .
Replace every with the input, wrapped in parentheses. The parentheses keep the negative sign attached to the square.
Check the second answer with . Directly, , and the simplified form gives . They agree.
The skill of putting a whole expression into is exactly what composition of functions uses. Evaluation also depends on the domain: if is outside the domain of , then does not exist, however neatly the formula could be typed.
Where do relations and functions appear in real life?
Anything where one quantity determines another is a function. Time determines the distance traveled at a constant speed, weight determines postage, and a student ID determines one student. Price tables that jump at thresholds are piecewise functions, and each input still gets exactly one price.
Relations that fail the test are just as common. A student and the clubs they belong to is a relation, since one student can join several. A person and their birthday is a function, but birthday to person is not, because two people can share a birthday.
A primary key, such as an ID number, is an input that determines exactly one row. That is why a record is a function of its key, and why duplicate keys cause errors.
Programming languages borrow the word too. A pure function returns the same output every time it receives the same input, which is the definition above and the reason such code is easy to test.
What is an inverse relation, and is it a function?
To reverse a relation, swap the coordinates of every pair. For an equation, swap and and solve for . The reversed relation always exists, but it is a function only when the original is one-to-one, with no output reached from two inputs.
Take :
Check: , and the reverse sends to . Lines with a nonzero slope always reverse cleanly, as the page on the inverse of a linear function shows.
Quadratics are the standard failure. Swapping in gives , a sideways parabola that fails the vertical line test. The repair is to restrict the domain to , which makes the reverse . The inverse of a quadratic function works through this restriction in detail.
Quick check
Answer:
How can you spot a function at a glance?
Knowing the shape of common graphs saves you from running the test every time. Lines, parabolas that open up or down, absolute value graphs, cubics and exponentials are all functions. Circles, ellipses, sideways parabolas and graphs of are not. The catalog of parent functions is worth memorizing for this reason.
One symmetry fact is a sharp shortcut. If a graph is symmetric about the -axis, then and both lie on it, so any point with makes it fail. Only the -axis itself survives. This is the opposite of even and odd functions, where symmetry about the -axis or the origin is allowed and common.
When a problem looks unclear, run through this order:
- Name the input and the output, and the direction you are testing.
- Look for a repeated input with different outputs.
- For an equation, solve for and look for .
- For a graph, sweep a vertical line across it.
Practice problems
0 of 5 solved
- Is the relation a function?
Answer: Yes
Step 1: List the inputs: . No input repeats. Step 2: The output appears twice, but repeated outputs are allowed. Each input has exactly one output, so it is a function. - State the domain and range of .
Answer: Domain , range
Step 1: The domain is the set of first coordinates: . Step 2: The range is the set of second coordinates, listing only once: . - If , find .
Answer:
Step 1: Replace with : . Step 2: Evaluate each term: and . Step 3: Add: . - Find the domain of .
Answer:
Step 1: The square root needs , so . Step 2: The denominator cannot be zero, so . Step 3: Combine: . - Find the range of .
Answer:
Step 1: , so . Step 2: Adding gives . Step 3: The value is reached at , so the range is .
Common questions
What is the difference between a relation and a function?
A relation is any set of ordered pairs. A function is a relation in which each input is paired with exactly one output, so every function is a relation but most relations are not functions.
Can a function have the same output for different inputs?
Yes. The function sends both and to . What a function cannot do is send one input to two different outputs.
Is a circle a function?
No. For almost every inside the circle there are two points with that -value, one above and one below, so a vertical line crosses the circle twice. Only the top half or the bottom half alone is a function.
Is the vertical line a function?
No. The single input is paired with every real number as an output. A horizontal line such as is a function, because each input has exactly one output.
How do you remember which is the domain and which is the range?
The domain is the set of inputs, the -values, and the range is the set of outputs, the -values. In an ordered pair the domain value comes first, just as domain comes before range.
What does it mean to say y is a function of x?
It means that choosing a value for determines exactly one value of . The statement depends on direction: makes a function of , but is not a function of there.