What Is a Function?
What Is a Function?
A function is a relation between a set of inputs and a set of outputs, such that each input is related to exactly one output.
A function f, relates an input x to an output f(x).
Dictionary Definition
The MerriamWebster dictionary defines a function as "a mathematical correspondence that assigns exactly one element of one set to each element of the same or another set".
A Real Example of a Function
It is easier to understand functions with an example.
f(x) = x + 1
The function f(x) = x + 1 takes each input and adds 1 to it.
The mapping diagram below shows this function.
Let us look at the function in function notation:

The name of the function is f.

The input is x. It is written in brackets after the name of the function.

The output is x + 1. It is written to the right of the equals (=) sign.
Properties of a Function
Let us take a closer look at the definition of a function:
A function is a relation between a set of inputs and a set of outputs, such that each input is related to exactly one output.

"each input": every input in the set must be related to an output in the other set.
The mapping diagram below shows that each input relates to an output. It doesn't matter that some outputs (7 and 13) aren't related to. It is a function:
In the mapping diagram below, some inputs (2 and 3) are not related to an output. It is not a function:

"exactly one output": each input relates to one output only.
The mapping diagram below shows that each input relates exactly one output. Sometimes, one input relates to one output (this is a onetoone mapping), such as 2 relating to 4. Sometimes, more than one input relates to one output (this is a manytoone mapping), such as both −3 and 3 relating to 9. This is a function:
In the mapping diagram below, one input (9) relates to more than on output (−3 and 3). This is a onetomany mapping. It is not a function:
Graphs of Functions
Function can be plotted on graphs.
Functions relate an input x to an output f(x). We can plot these pairs of inputs and outputs as Cartesian coordinates, (x, f(x)).

The input x is the xcoordinate. It is plotted on the xaxis.

The output f(x) is the ycoordinate. It is plotted on the yaxis.
The Vertical Line Test
Each input can only be related to one output. Each value of x can only be related to one value of f(x).
On a graph, this means that any vertical line only crosses the curve once. This is the vertical line test.
The curve below passes the vertical line test. Any vertical line that is drawn will cross the curve only once. It is a function:
The curve below does not pass the vertical line test. A vertical line can be drawn which crosses the curve twice. It is not a function: