Math glossary

Types of Functions in Math: Mapping, Rules, and Examples

Compare types of functions by mapping, formula, domain, and graph. Learn one-to-one, onto, even, odd, inverse and composite with examples.

TL;DR

Types of functions describe how inputs map to outputs, what a rule looks like, or how its graph behaves. Start with the domain and codomain, then test the property the problem asks about.

Key Points

  • The domain contains allowed inputs, the codomain names allowed outputs, and the range contains output values the function actually reaches.
  • A one-to-one function sends distinct inputs to distinct outputs, while an onto function reaches every element of its stated codomain.
  • One function can belong to several types, such as a quadratic that is also polynomial, even and many-to-one on the real numbers.
  • Changing the domain or codomain can change whether the same formula is one-to-one, onto or invertible.

What are the main types of functions?

A function assigns exactly one output to each input in its domain. OpenStax introduces functions by testing this condition in rules, tables and graphs. To classify one, first ask what sort of classification the question uses.

Classification What it checks Examples
Mapping Whether outputs repeat and whether every allowed target is reached One-to-one, many-to-one, onto, into, bijective
Formula or degree How the rule builds the output Constant, linear, quadratic, cubic, polynomial, rational
Output or input restrictions Which values a rule accepts or produces Absolute value, step, real-valued, sequence
Graph behavior Whether values reflect, repeat or preserve order Even, odd, periodic
Relationship with other rules Whether the function reverses or combines mappings Inverse, composite

The domain and range describe different sides of the rule. In f:A→Bf:A\to B, the domain is AA and the codomain is BB. The range is the set of actual outputs inside BB. Those sets matter when you decide whether the rule reaches every allowed output.

How do one-to-one, many-to-one and onto functions differ?

Check separately for repeated outputs and unused codomain values. The University of California, Davis, handout on functions uses these two independent tests to distinguish injective, surjective and bijective mappings.

Types of functions mapping diagram comparing multiple inputs sharing an output with a relation where one input has two outputs
The left diagram is a valid many-to-one function. The right diagram fails the function rule because one input points to two outputs.
Term Test
One-to-one, or injective If f(a)=f(b)f(a)=f(b), then a=ba=b.
Many-to-one Two different inputs give the same output.
Onto, or surjective Every element of the codomain is the output of at least one input.
Into In texts using this contrast, the range is a proper subset of the codomain.
Bijective Each codomain element comes from exactly one input. The function is both one-to-one and onto.

A function can be many-to-one and onto at the same time. For example, if the codomain in the left-hand diagram contained only A and B, the arrows would reach every target even though A has two preimages. Leaving C in the codomain makes the same arrows into rather than onto.

How do you test a function from a graph?

A vertical line test checks whether a relation assigns more than one output to an input. A horizontal line test checks whether a valid function reaches the same output from more than one input. OpenStax uses both checks with plotted relations.

For injectivity, each horizontal line may meet the graph at most once. To check that the function is onto, you still need the stated codomain. Every horizontal level belonging to that codomain must meet the graph at least once.

How do you classify a function by its formula or degree?

Classify a polynomial by its highest power after simplification. Classify other formulas by how they use roots, ratios, signs, or exponents. OpenStax’s domain and range chapter illustrates the standard toolkit functions and piecewise rules.

Family Example What to notice
Constant f(x)=5f(x)=5 Every allowed input maps to the same output.
Identity f(x)=xf(x)=x The output equals the input.
Linear, degree one f(x)=2x+3f(x)=2x+3 The graph has a constant nonzero slope in this definition.
Quadratic, degree two f(x)=x2−1f(x)=x^2-1 The largest remaining power is two.
Cubic, degree three f(x)=x3−xf(x)=x^3-x The largest remaining power is three.
Other polynomial f(x)=x4+x+1f(x)=x^4+x+1 The powers of xx are nonnegative integers.
Rational f(x)=1x−3f(x)=\frac{1}{x-3} A quotient of polynomials requires a nonzero denominator.
Radical f(x)=xf(x)=\sqrt{x} The real square-root example requires x≥0x\ge0.
Absolute value f(x)=|x|f(x)=\lvert x\rvert The rule applies two different formulas according to the sign of xx.
Exponential f(x)=2xf(x)=2^x The input appears in the exponent.
Logarithmic f(x)=log2xf(x)=\log_2 x The input to a real logarithm must be positive.
Trigonometric f(x)=sinxf(x)=\sin x The rule relates an angle input to a trig value.

Polynomial, rational and many radical functions are algebraic. Exponential, logarithmic and trigonometric functions are common transcendental examples. Some courses write the family mx+bmx+b with m=0m=0 included and call the resulting horizontal graph a linear function. For polynomial degree, a nonzero constant has degree zero.

The formula also suggests the possible outputs. The absolute-value and square-root functions shown here produce nonnegative real values. A greatest-integer function ⌊x⌋\lfloor x\rfloor rounds downward to the nearest integer and produces integer values. A ceiling function ⌈x⌉\lceil x\rceil rounds upward. A sign function returns −1-1, 00 or 11 according to whether the input is negative, zero or positive.

The domain can also determine the type. A sequence is a function whose inputs are usually an integer index such as 1,2,3,…1,2,3,\ldots. Its outputs might be real values, even though the inputs are discrete. A real-variable function can take a whole interval of inputs instead.

What makes a function even, odd or periodic?

Compare outputs at related inputs. OpenStax’s transformations chapter describes even and odd functions in terms of graph reflections.

  • Even. If the domain is symmetric about zero and f(−x)=f(x)f(-x)=f(x), the graph is symmetric about the y-axis.
  • Odd. If the domain is symmetric about zero and f(−x)=−f(x)f(-x)=-f(x), reflecting through the origin preserves the graph.
  • Periodic. A positive number TT is a period if shifting allowed inputs by TT preserves the domain and f(x+T)=f(x)f(x+T)=f(x) throughout it.

Polynomial degree alone does not determine parity. The function x2+x+1x^2+x+1 has even degree, but the first-power term makes the values at xx and −x-x differ for most nonzero xx.

How do composite and inverse functions work?

A composite passes one function’s output into another function. OpenStax’s lesson on composition writes this as

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

The output of gg must be an allowed input of ff, so the composition can have a more limited domain. Interchanging ff and gg usually changes the result.

An inverse reverses a mapping. An inverse on the entire stated codomain is itself a function when the original mapping is bijective. If the original function is one-to-one but misses some codomain values, it has an inverse defined on its range. The OpenStax inverse-functions lessons verify this by composing in both directions. The inverse operations guide explains the idea of undoing a rule.

Examples of Types of Functions

Separate the mapping from the formula. The same expression can receive different mapping labels when you change the stated sets.

Example 1

Classify f(x)=2x+1f(x)=2x+1 as a function from the real numbers to the real numbers.

  1. If 2a+1=2b+12a+1=2b+1, subtracting 1 and dividing by 2 gives a=ba=b. The function is one-to-one.
  2. For any real target yy, the input x=y−12x=\frac{y-1}{2} maps to that target.
  3. The function is onto as well, so it is bijective.

Example 2

Is f(x)=x2f(x)=x^2 bijective from the real numbers to the real numbers?

  1. Substituting x=yx=\sqrt y may look like it reaches every output, but a negative target such as y=−4y=-4 has no real square root.
  2. Also, inputs 22 and −2-2 both give 44, so the rule is many-to-one.
  3. Restrict both the domain and codomain to [0,∞)[0,\infty). Then each nonnegative target yy has exactly one input, y\sqrt y, and the restricted mapping is bijective.

Example 3

Classify g(x)=2xg(x)=2^x as a function from the real numbers to the real numbers.

  1. Increasing the exponent strictly increases the output, so the function is one-to-one.
  2. The output is always positive. Zero and negative numbers in the codomain are missed.
  3. This is an exponential function and an example of a one-to-one, into mapping.

Example 4

Find the natural real domain and range of h(x)=1x−3h(x)=\frac{1}{x-3}.

  1. Exclude x=3x=3, since the denominator would vanish.
  2. Exclude y=0y=0 from the range, since a nonzero numerator divided by a finite nonzero number cannot produce zero.
  3. For any nonzero yy, choosing x=3+1yx=3+\frac1y gives h(x)=yh(x)=y. The range is every real number except zero.

Example 5

Decide whether p(x)=x3−xp(x)=x^3-x is even or odd. Is it one-to-one on the real numbers?

  1. Substitute −x-x to get p(−x)=−x3+x=−p(x)p(-x)=-x^3+x=-p(x), so it is odd.
  2. Check p(−1)p(-1), p(0)p(0) and p(1)p(1). They all equal zero.
  3. The function is many-to-one. Parity and injectivity describe different properties.

Example 6

Let f(x)=2x+3f(x)=2x+3 and g(x)=x2g(x)=x^2. Compare f(g(x))f(g(x)) with g(f(x))g(f(x)).

  1. Applying gg first gives f(g(x))=2x2+3f(g(x))=2x^2+3.
  2. Applying ff first gives g(f(x))=(2x+3)2g(f(x))=(2x+3)^2.
  3. At x=1x=1 the results are 5 and 25, so the compositions are different functions.

Where can a function classification go wrong?

Check the actual rule and sets. A shortcut based on a graph’s appearance can answer a different classification question.

Mistake 1. Treating a many-to-one rule as an invalid function

Where it slips in

Two arrows arrive at the same target, and the shared output looks like a violation.

The tempting calculation

Rejecting x↦x2x\mapsto x^2 because −3-3 and 33 both map to 9 confuses incoming arrows with outgoing arrows.

The correction

Check each input separately. A function requires one output per input. Distinct inputs can share an output.

Mistake 2. Calling a function onto without naming its codomain

Where it slips in

The graph shows every value in its own range, which is true of any graph.

The tempting calculation

Saying |x|\lvert x\rvert “reaches every output” ignores negative elements if the codomain is all real numbers.

The correction

Read the codomain first. With real inputs, |x|\lvert x\rvert is onto [0,∞)[0,\infty) and into the full set of real numbers.

Practice with answers

  1. Is f(x)=x−7f(x)=x-7 from real numbers to real numbers injective, onto or both?
  2. Is g(x)=|x|g(x)=\lvert x\rvert with real inputs and nonnegative-real codomain one-to-one or onto?
  3. Classify h(x)=x2+x+1h(x)=x^2+x+1 by polynomial degree and parity.

Check your solutions

  1. For any target yy, the unique input is x=y+7x=y+7. The function is both injective and onto.
  2. It reaches every nonnegative value, so it is onto. Opposite nonzero inputs give the same output, so it is many-to-one.
  3. It has degree two. Substituting −x-x gives x2−x+1x^2-x+1, which is generally neither h(x)h(x) nor −h(x)-h(x). The function is neither even nor odd.

Frequently Asked Questions

Can a function belong to more than one type?

Yes. Sine is a trigonometric function, an odd function, and a periodic function. A type describes the property you are currently checking.

Is every linear function one-to-one?

A function f(x)=mx+bf(x)=mx+b with m≠0m\ne0 is one-to-one. If m=0m=0 and the domain has several inputs, the constant rule repeats the same output.

Can a function be both even and odd?

The zero function on a symmetric domain satisfies both identities. Any function that satisfies both must equal its own negative at every input and therefore be zero there.

What to Remember About Function Types

  • Name the domain and codomain before applying mapping labels.
  • Test for repeated outputs and unused codomain values separately.
  • A formula’s family, degree and symmetry can all describe the same function.
  • Check domains when composing or reversing rules.

Read More

Research Behind This Article

  1. OpenStax, Algebra and Trigonometry, Functions and Function Notation. OpenStax.
  2. University of California, Davis, ECS 20 Handout 4, Functions. UC Davis course notes.
  3. OpenStax, Algebra and Trigonometry, Domain and Range. OpenStax.
  4. OpenStax, Algebra and Trigonometry, Transformation of Functions. OpenStax.
  5. OpenStax, Algebra and Trigonometry, Composition of Functions. OpenStax.
  6. OpenStax, College Algebra with Corequisite Support 2e, Inverse Functions. OpenStax.