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 .
- = domain (set of legal inputs), denoted .
- = codomain (declared target set).
- The range (or image) is the actually-achieved subset:
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
Composition
Given and , the composition is
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
Why It Holds / Derivation
Bijectivity ⇔ Invertibility
Steps:- (⇐ Suppose is bijective.) For each , surjectivity [4] guarantees some with , and injectivity [3] guarantees that is unique. Define to be that unique .
- This rule assigns exactly one output to each , so by [1] it is a genuine function .
- By construction . And for any , applying the rule to returns the unique preimage of , which is itself, giving . Both identities of [7] hold.
- (⇒ 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 :
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,
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
Worked Examples
Domain, Range, and Composition with Numbers
Given: and . Find the natural domain of , the range of , and with its domain. Steps:- Domain of : need . So .
- Range of : and grows without bound, so .
- Compose: .
- Domain of : start with (so is defined). Then exclude where , i.e. .
Finding an Inverse and Verifying It
Given: , defined for . Find , and verify [7] at a test value. Steps:- Set and solve for :
- Hence , so swapping names:
- Check ranges/domains match: ✓ (the excluded output is the horizontal asymptote).
- Verify [7] at : . Then ✓.
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
- 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.
- Unit conversion. Celsius-to-Fahrenheit is a bijection; its inverse converts back exactly.
- GPS and signal processing. The Fourier transform is an invertible map between time and frequency domains; the inverse transform reconstructs the signal.
- Economics — supply/demand. Inverse demand functions express price as a function of quantity, obtained by inverting quantity-as-function-of-price.
- Computer graphics. Coordinate transformations (rotation, scaling) are compositions of functions; rendering pipelines chain dozens of them.
- Chemistry — Beer–Lambert law. Absorbance is a function of concentration; inverting it lets a spectrophotometer report unknown concentrations.
- 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.