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 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
A function from a set to a set , written , is a rule assigning to each exactly one element .
Derivation hint: 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:
Derivation hint: 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).
Derivation hint: contrapositive of "distinct inputs give distinct outputs."
Derivation hint: every codomain element is hit, i.e. .
Derivation hint: combine [3] and [4]; bijectivity is exactly the condition for an inverse to exist.
Given and , the composition is
Derivation hint: apply first, then feed its output into ; the input must survive both stages.
A function has a two-sided inverse if and only if is bijective. When it exists, is unique and satisfies
Derivation hint: undoes on both sides; these two identities say and .
Why It Holds / Derivation
Steps: 1. (⇐ Suppose is bijective.) For each , surjectivity [4] guarantees some with , and injectivity [3] guarantees that is unique. Define to be that unique . 2. This rule assigns exactly one output to each , so by [1] it is a genuine function . 3. By construction . And for any , applying the rule to returns the unique preimage of , which is itself, giving . Both identities of [7] hold. 4. (⇒ Suppose an inverse exists with and .) If , apply : , so is injective. For any , exhibits a preimage, so is surjective. Hence is bijective.
∎Suppose and both invert . Then for every :
So ; the inverse is unique.
∎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 .
Worked Examples
Given: and .
Find the natural domain of , the range of , and with its domain.
Steps: 1. Domain of : need . So . 2. Range of : and grows without bound, so . 3. Compose: . 4. Domain of : start with (so is defined). Then exclude where , i.e. .
Answer:
Given: , defined for .
Find , and verify [7] at a test value.
Steps: 1. Set and solve for :
2. Hence , so swapping names:
3. Check ranges/domains match: ✓ (the excluded output is the horizontal asymptote). 4. 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
Historical Development
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