Functions — Domain, Range, Composition, Inverses

A function assigns each input exactly one output; its domain is the set of allowed inputs, its range the set of achieved outputs. Composition chains functions ( means "do , then "), and an inverse undoes exactly when is one-to-one and onto. Used everywhere in algebra, calculus, and applied modelling. Formalised through the 17th–19th centuries (Leibniz, Euler, Dirichlet).

A function is a rule pairing every element of a set (the domain) with exactly one element of a set (the codomain); the subset of actually hit is the range. Functions matter because almost every quantitative relationship — physical law, financial model, computer program — is a function, and understanding domain restrictions, composition, and reversibility is essential to manipulating them safely. A surprising fact: the deceptively simple requirement "exactly one output" is exactly what lets us invert, differentiate, and compose reliably — and the moment it fails (e.g. giving ), an entire branch of analysis must be restricted to make sense of it.

The Core Insight

A function is a machine with a guarantee: feed it a legal input and you get one, and only one, output. Three operations follow naturally. Domain/range ask what is legal in and what comes out. Composition asks what happens when the output of one machine becomes the input of another. Inversion asks can we run the machine backward — possible only when no two inputs share an output (injective) and every target value is reached (surjective).

Formal Statement

Function, Domain, Codomain, Range

A function from a set to a set , written , is a rule assigning to each exactly one element .

1
⟳the symbol means "there exists exactly one"; this is the defining single-valuedness property.
  • = domain (set of legal inputs), denoted .
  • = codomain (declared target set).
  • The range (or image) is the actually-achieved subset:
2
⟳collect every output as runs over all of ; this need not be all of .

For real functions given by a formula with no stated domain, the natural domain is the largest subset of on which the formula is defined (no division by zero, no even root of a negative, no log of a non-positive).

Injective, Surjective, Bijective

3
⟳contrapositive of "distinct inputs give distinct outputs."
4
⟳every codomain element is hit, i.e. .
5
⟳combine [3] and [4]; bijectivity is exactly the condition for an inverse to exist.

Composition

Given and , the composition is

6
⟳apply first, then feed its output into ; the input must survive both stages.

Existence of the Inverse Function

A function has a two-sided inverse if and only if is bijective. When it exists, is unique and satisfies

7
⟳ undoes on both sides; these two identities say and .

Why It Holds / Derivation

Bijectivity ⇔ Invertibility

Steps:
  1. (⇐ Suppose is bijective.) For each , surjectivity [4] guarantees some with , and injectivity [3] guarantees that is unique. Define to be that unique .
  1. This rule assigns exactly one output to each , so by [1] it is a genuine function .
  1. By construction . And for any , applying the rule to returns the unique preimage of , which is itself, giving . Both identities of [7] hold.
  1. (⇒ Suppose an inverse exists with and .) If , apply : , so is injective. For any , exhibits a preimage, so is surjective. Hence is bijective.

Uniqueness of the Inverse

Suppose and both invert . Then for every :

So ; the inverse is unique.

Peter Gustav Lejeune Dirichlet | 1805–1859

Dirichlet gave (1837) the modern definition of a function as an arbitrary correspondence — is a function of if to each there corresponds a single definite , regardless of any formula. His "monster," the indicator function of the rationals,

deliberately had no analytic expression, forcing mathematicians to accept that "function" means rule of assignment, not formula. This freed the concept from the Eulerian view of functions as expressions and underpins all subsequent analysis.

Building Intuition

Think of a function as a vending machine. The domain is the list of buttons that actually do something; pressing a nonexistent button (input outside the domain) yields nothing — undefined. The range is the set of snacks you can possibly get out. Single-valuedness means each button gives the same product every time — a machine that randomly dispensed chips or a soda would not be a function.

Composition is two machines in series: button on machine produces a token, which you feed into machine . You can only do this if 's token is a valid input for — hence the domain restriction in [6]. Inverse is a refund machine: insert the snack, get your money back. This is only sensible if (a) two different buttons never give the same snack (otherwise the refund machine wouldn't know which button to credit — injectivity), and (b) every snack on the shelf was actually obtainable (surjectivity). Graphically, injectivity is the horizontal line test, and the inverse's graph is the original reflected across .

Reflection of a function and its inverse across the line y = x

x y y = x y = f(x) y = f⁻¹(x) (a, b) (b, a)

Worked Examples

Domain, Range, and Composition with Numbers

Given: and . Find the natural domain of , the range of , and with its domain. Steps:
  1. Domain of : need . So .
  1. Range of : and grows without bound, so .
  1. Compose: .
  1. Domain of : start with (so is defined). Then exclude where , i.e. .
Answer:

Finding an Inverse and Verifying It

Given: , defined for . Find , and verify [7] at a test value. Steps:
  1. Set and solve for :
  1. Hence , so swapping names:
  1. Check ranges/domains match: ✓ (the excluded output is the horizontal asymptote).
  1. Verify [7] at : . Then ✓.
Answer:

Common Misconceptions

Pitfall 1 — " means ." The superscript on a function denotes the inverse function, not the reciprocal. For , , not . Pitfall 2 — composition order. applies first. In general ; composition is not commutative. Pitfall 3 — forgetting domain restrictions in composition. Simplifying algebraically can hide excluded points. The domain of the composite is determined before any cancellation, from [6]. Pitfall 4 — assuming every function has an inverse. Only bijective functions do. Many "inverses" in school (like ) exist only after restricting the domain to make the original injective.

Let on . This is not invertible: it fails the horizontal line test because , violating injectivity [3]. There is no single rule with returning both and .

The fix is to restrict the domain to , where becomes injective; then is well-defined. This is exactly why (not ): the square-root symbol denotes the inverse of the restricted squaring function. The same restriction strategy gives , , and .

Connections

Domain and range are the natural arena for Limits and Continuity — a limit asks about behaviour near a domain point, possibly one not in the domain. Composition underlies the Chain Rule in differentiation: is composition made dynamic. Inverses connect to Logarithmic and Exponential Functions (mutual inverses) and to Inverse Trigonometric Functions. The bijection concept is the backbone of Cardinality of Sets, where "same size" means "there exists a bijection." Reflection across links to Transformations of Graphs.

Real-World Applications

  1. Cryptography (RSA). Encryption is a bijective function on residues; decryption is its inverse. Security rests on the inverse being computationally hard without the private key.
  1. Unit conversion. Celsius-to-Fahrenheit is a bijection; its inverse converts back exactly.
  1. GPS and signal processing. The Fourier transform is an invertible map between time and frequency domains; the inverse transform reconstructs the signal.
  1. Economics — supply/demand. Inverse demand functions express price as a function of quantity, obtained by inverting quantity-as-function-of-price.
  1. Computer graphics. Coordinate transformations (rotation, scaling) are compositions of functions; rendering pipelines chain dozens of them.
  1. Chemistry — Beer–Lambert law. Absorbance is a function of concentration; inverting it lets a spectrophotometer report unknown concentrations.
  1. Database joins and lookups. A primary-key lookup is a function; a one-to-one relationship is exactly an injective mapping between tables.

Historical Development

  • c. 1350 — Oresme plots qualities against extension, an early graphical sense of dependence.
  • 1673 — Leibniz introduces the word function (Latin functio) for quantities depending on a curve.
  • 1718 — Johann Bernoulli defines a function as an expression formed from a variable and constants.
  • 1748 — Euler (Introductio in analysin infinitorum) treats functions as analytic expressions and introduces the notation .
  • 1822 — Fourier shows discontinuous functions can be represented by trigonometric series, straining the "expression" view.
  • 1829–1837 — Dirichlet gives the modern arbitrary-correspondence definition and his pathological indicator function.
  • 1872 — Weierstrass exhibits a continuous, nowhere-differentiable function, cementing the abstract view.
  • 1888–1895 — Dedekind & Cantor formalise functions set-theoretically and use bijections to define cardinality.
  • 1914 — Hausdorff and the early 20th-century set theorists encode a function as a set of ordered pairs, the definition used today.

Subtleties & Limits

The "function as set of ordered pairs" definition is clean but raises deep questions. The Axiom of Choice is needed to guarantee a choice function selecting one element from each of infinitely many nonempty sets — a function whose existence cannot be proved constructively. In analysis, distinguishing functions that are defined everywhere but wildly discontinuous (Dirichlet's), from continuous ones, motivated measure theory and the question of which functions can be integrated. At the foundational frontier, constructive mathematics rejects non-computable functions, so even the seemingly settled notion of "function" splits into competing schools depending on whether one demands an explicit algorithm. Whether a clean "inverse" exists for broad classes of maps (e.g. the open question of efficiently inverting cryptographic one-way functions, tied to P vs NP) remains unresolved.

See Also

Graphs of Functions · Transformations of Graphs · Inverse Trigonometric Functions · Logarithmic and Exponential Functions · The Chain Rule · Cardinality of Sets · Limits and Continuity

Before this

Where this leads