Lesson M1.4: Functions: Definitions and Notation

Module M1: Foundations Prerequisites: M1.1–M1.3 Duration: ~3 hours

The four levels mark mathematical depth. Every level explains its notation and names the background it uses. Expand the notes beside expressions for a plain-language reading and an example.

Prerequisites: Lessons M1.1–M1.3

Estimated study time: 3 hours

Learning Objectives

High-school level — Inputs, outputs, and graphs

A function is a rule with one output for each allowed input. Tables, formulas, and graphs are three ways to communicate a rule. Begin by asking what inputs are allowed and what outputs actually appear; later levels make those questions precise enough for proofs and models.

1. What is a function?

A function \(f:A\to B\) assigns exactly one element \(f(x)\in B\) to every input \(x\in A\). The set \(A\) is the domain, \(B\) is the codomain, and the range (or image) is \(f(A)=\{f(x):x\in A\}\subseteq B\). The assignment need not use every value in \(B\).

Explain the function arrow

Read the whole expression: f maps the set A into the set B: every input from A receives exactly one output in B.

f
Name of the function, or assignment rule.
A, domain
The set of allowed inputs.
→, 'maps to'
The rule sends inputs on the left to outputs on the right.
B, codomain
The declared set that contains every output; some values may never occur.

Example: If f(x)=x² sends real inputs to real outputs, f(−2)=4 and f(2)=4; negative outputs never occur.

For example, \(f:\mathbb R\to\mathbb R\), \(f(x)=x^2\), has range \([0,\infty)\), even though its codomain is all of \(\mathbb R\). A different declaration, \(f:\mathbb R\to[0,\infty)\) with the same rule, has a different codomain. The declared domain matters too: \(x^2\) on \(\mathbb R\) and \(x^2\) on \([0,\infty)\) are different functions, and only the latter has an inverse from its range back to its domain.

The notation \(f(x)\) means the output at input \(x\). It does not mean \(f\) multiplied by \(x\). To evaluate \(f(a+h)\), substitute the entire expression \(a+h\) for the input.

Example. For \(f(x)=x^2-3x\),

\[\begin{aligned}f(a+h)&=(a+h)^2-3(a+h)\\&=a^2+2ah+h^2\\&\quad-3a-3h.\end{aligned}\]

This substitution is the starting point for the difference quotient in calculus.

Graphs and the vertical line test

The graph is \(\{(x,f(x)):x\in A\}\). Every vertical line intersects a function graph at most once. An intersection is not required when that \(x\) is outside the domain. The circle \(x^2+y^2=1\) fails this test: for most \(x\in(-1,1)\), there are two \(y\)-values.

2. Domain and range

When a formula is supplied without a stated domain, its natural real domain consists of all real inputs for which the formula has a real value. In particular, denominators cannot be zero and even-root radicands must be nonnegative. A stated domain may restrict this further.

Example: combined restrictions. For

\[f(x)=\frac{\sqrt{9-x^2}}{x-1},\]

the radicand requires \(-3\le x\le3\), and the denominator excludes \(x=1\). Thus the domain is \([-3,1)\cup(1,3]\). Do not cancel or otherwise simplify a formula before recording its original exclusions.

The range answers a different question: which outputs actually occur? For \(f(x)=x^2\) on \([-2,3]\), the minimum is \(0\) at \(x=0\) and the maximum is \(9\) at \(x=3\). Every value between them occurs, so the range is \([0,9]\). The codomain must contain this range; it need not equal it.

Explain the image or range of a function

Read the whole expression: f of A is the set of all outputs f of x as x runs through the allowed inputs A.

f(A), 'image of A'
Outputs actually attained by f on A.
{ : }, set-builder braces
Collect all values satisfying the stated rule.
∈, 'belongs to'
The input x must be an allowed member of A.
⊆, 'is contained in'
Every actual output lies in the codomain B.

Example: For f(x)=x² on A=[−2,3], f(A)=[0,9], even if the codomain is all real numbers.

Piecewise functions

A piecewise rule assigns one expression to each part of the domain. Check the condition before evaluating:

\[p(x)=\begin{cases}x+1,&x<0,\\x^2,&0\le x\le2,\\5,&x>2.\end{cases}\]

Here \(p(-2)=-1\), \(p(0)=0\), \(p(2)=4\), and \(p(3)=5\). The first branch gives \(( -\infty,1)\), the middle gives \([0,4]\), and the last gives \(\{5\}\). Their union is \(( -\infty,4]\cup\{5\}\). A boundary belongs to the branch whose inequality includes equality.

3. Transformations and simple models

Starting with \(y=f(x)\):

New rule Effect on the graph
\(f(x)+k\) Shift up by \(k\) (down if \(k<0\))
\(f(x-h)\) Shift right by \(h\) (left if \(h<0\))
\(af(x)\) Multiply output heights by \(|a|\); reflect across the horizontal axis if \(a<0\)
\(f(bx)\) Multiply input coordinates by \(1/|b|\); reflect across the vertical axis if \(b<0\), for \(b\ne0\)

For \(f(x)=|x|\), the graph of \(y=-2f(x+3)+1=-2|x+3|+1\) has vertex \((-3,1)\), opens downward, and has range \(( -\infty,1]\).

Explain this graph transformation

Read the whole expression: Take the absolute value of x plus three, double it, reflect it downward, and move it up one.

x+3
Shifts the basic absolute-value graph three units left.
| |
Measures distance from the shifted vertex.
−2
Doubles vertical distances and reflects them across the horizontal axis.
+1
Moves the resulting graph up one unit.

Example: At x=−3, the absolute-value part is zero, so the new vertex is (−3,1).

Function notation also keeps a model's units and domain clear. If \(R(q)=50q\) and \(C(q)=120+20q\) are revenue and cost in dollars for \(q\) units, profit is \(P(q)=R(q)-C(q)=30q-120\), for feasible \(q\ge0\) (usually whole units). The break-even input solves \(P(q)=0\), namely \(q=4\).

Undergraduate level — Combining rules with domains

Algebraically combining functions is only valid on inputs accepted by all relevant rules. Composition also asks whether the inner output is an allowed outer input. This domain bookkeeping is a prerequisite for calculus and analysis.

4. Combining and composing functions

If \(f\) and \(g\) are real-valued, \((f+g)(x)=f(x)+g(x)\) and \((fg)(x)=f(x)g(x)\) are defined where both inputs are allowed. The quotient \((f/g)(x)=f(x)/g(x)\) also requires \(g(x)\ne0\).

Composition means doing the inner function first:

\[(f\circ g)(x)=f(g(x)).\]

Explain function composition

Read the whole expression: f circle g at x means apply g to x first, then apply f to that result.

∘, 'composed with'
Orders two rules; the right-hand rule acts first.
g(x)
Inner output that becomes the next input.
f(g(x))
Final output, defined only when g(x) is in f's domain.

Example: If g(x)=x+1 and f(t)=t², then (f∘g)(2)=f(3)=9, while (g∘f)(2)=g(4)=5.

Its domain is \(\{x\in\operatorname{dom}(g):g(x)\in\operatorname{dom}(f)\}\). Order matters: generally \(f\circ g\ne g\circ f\).

Example. Let \(f(x)=\sqrt{x-1}\), with domain \([1,\infty)\), and \(g(x)=x^2-2\), with domain \(\mathbb R\). Then

\[\begin{aligned}(f\circ g)(x)&=\sqrt{x^2-3},\\\operatorname{dom}(f\circ g)&=(-\infty,-\sqrt3]\\&\quad\cup[\sqrt3,\infty).\end{aligned}\]

Conversely, \((g\circ f)(x)=(\sqrt{x-1})^2-2=x-3\), but its domain is still \([1,\infty)\). The simplified rule \(x-3\) does not extend this composition to inputs below \(1\).

Master's level — Inverses and proof of uniqueness

An inverse is a function only if each attained output points back to one input. Distinguish this one-to-one condition from being onto a declared codomain. To prove a composition is one-to-one, begin with equality of outputs and work back to equality of inputs; Problem 8 gives a careful example. A horizontal-line picture helps intuition, but the definition supplies the proof.

5. One-to-one functions and inverses

A function is one-to-one (injective) if \(f(a)=f(b)\) implies \(a=b\). On a graph, every horizontal line then intersects at most once. A function has an inverse \(f^{-1}:f(A)\to A\) precisely when it is one-to-one, if the inverse's domain is taken to be the range of \(f\). To have an inverse defined on the entire declared codomain \(B\), \(f:A\to B\) must also be onto \(B\).

For an invertible function,

\[\begin{aligned}f^{-1}(f(x))&=x\quad(x\in A),\\f(f^{-1}(y))&=y\quad(y\in f(A)).\end{aligned}\]

The notation \(f^{-1}\) does not mean \(1/f\).

Explain inverse-function notation

Read the whole expression: f inverse takes an output of f and returns the input that produced it.

f⁻¹
Inverse function; the superscript does not mean reciprocal here.
f(A)
Domain of the inverse: outputs actually attained by f.
A
Codomain of the inverse: the original input set.
one-to-one
Different original inputs must have different outputs.

Example: If f(x)=3x−2, the output 10 came from x=4, so f⁻¹(10)=4; 1/f(10) would instead be 1/28.

Example. If \(f:\mathbb R\to\mathbb R\) is \(f(x)=3x-2\), write \(y=3x-2\) and solve for \(x\): \(x=(y+2)/3\). Thus \(f^{-1}(x)=(x+2)/3\). Substitution in both directions verifies the inverse.

The function \(x\mapsto x^2\) is not one-to-one on \(\mathbb R\), because \(f(-2)=f(2)\). Restricted to \([0,\infty)\), it is one-to-one with inverse \(x\mapsto\sqrt{x}\) on \([0,\infty)\). Restricting the domain changes the function.

PhD-level connection — Identifiability and stable inversion

Prerequisite bridge. In an inverse problem, an observed output y=f(x) is used to recover an unknown input x. If f is not one-to-one, two inputs can produce the same observation, so unique recovery is impossible: this is a failure of identifiability. Even if f is one-to-one, small output errors may cause large input errors.

Suppose there is a constant c>0 such that |f(x)−f(y)|≥c|x−y| for every two allowed inputs. Then f is one-to-one, and its inverse on the range obeys

\[|f^{-1}(u)-f^{-1}(v)|\le \frac1c|u-v|.\]

To prove this, write u=f(x), v=f(y) and rearrange the lower bound. The inverse is then Lipschitz: output errors of size ε cause input errors of at most ε/c. This condition is sufficient, not necessary, for a continuous inverse. For f(x)=x³ on [−1,1], an inverse exists, but no positive c works near zero; Problem 10 investigates the resulting sensitivity. A full study of inverse problems adds noise models, regularization, and multivariable maps.

Explain the inverse-stability bound

Read the whole expression: The distance between recovered inputs is at most one over c times the distance between their observed outputs.

f⁻¹
The inverse on outputs that f actually attains.
u, v
Two observed outputs in the range of f.
| |
Distance between two real numbers.
c>0
A single positive lower-separation constant for all input pairs.
≤
The recovered-input distance cannot exceed this bound.

Example: For f(x)=2x+1, c=2 works exactly; if two outputs differ by 0.1, their inputs differ by 0.05.

Practice Problems

Try these before reading the solutions. State domains whenever a function is introduced without one.

Basic

  1. Find the natural real domain of \(f(x)=\dfrac{\sqrt{x+4}}{x-2}\).
  2. Find the range of \(f(x)=x^2-4\) on the stated domain \([-1,3]\).
  3. Let \(h(x)=x^2\) for \(x<1\), and \(h(x)=2x+1\) for \(x\ge1\). Find \(h(-2)\), \(h(1)\), and \(h(h(-2))\).

Intermediate

  1. Let \(f(x)=\sqrt{x+2}\) and \(g(x)=1/(x-1)\), each on its natural real domain. Find \(f\circ g\) and \(g\circ f\), with the exact domain of each.
  2. Let \(f(x)=(2x-3)/(x+1)\), \(x\ne-1\). Show that it is one-to-one, find its range and inverse, and verify one composition.
  3. Explain why \(x^2\) has no inverse on \(\mathbb R\). Restrict its domain to make an inverse, and give that inverse's domain.
  4. Describe the transformations from \(y=|x|\) to \(y=-2|x+3|+1\). State the new vertex and range.

Exam-level and application

  1. Suppose \(f:A\to B\) and \(g:B\to C\), and \(g\circ f\) is one-to-one. Prove that \(f\) is one-to-one. Give an example where \(g\circ f\) is one-to-one but \(g\) is not one-to-one on all of \(B\).
  2. For \(R(q)=50q\) and \(C(q)=120+20q\), find the profit function, profit at \(q=10\), and the break-even quantity. State a reasonable domain for \(q\).

PhD-level practice, Problem 10. On [−1,1], let f(x)=x³. Prove that f is one-to-one, then show that no c>0 can satisfy |f(x)−f(y)|≥c|x−y| for all x,y in the interval. Explain what this says about recovery near zero, and compare f(x)=2x+1.

Solutions

1. Natural domain

The square root needs \(x+4\ge0\), so \(x\ge-4\). The denominator needs \(x\ne2\). The domain is \([-4,2)\cup(2,\infty)\).

2. Range on a restricted interval

The minimum of \(x^2-4\) is \(-4\) at \(x=0\). On \([-1,3]\), the largest \(x^2\) is \(9\) at \(x=3\), giving \(5\). Continuity fills all intermediate values, so the range is \([-4,5]\).

3. Piecewise evaluation

Because \(-2<1\), \(h(-2)=(-2)^2=4\). Because \(1\ge1\), \(h(1)=2(1)+1=3\). Finally \(h(h(-2))=h(4)=2(4)+1=9\).

4. Composition domains

\[(f\circ g)(x)=\sqrt{\frac1{x-1}+2}=\sqrt{\frac{2x-1}{x-1}}.\]

Require \(x\ne1\) and \((2x-1)/(x-1)\ge0\). A sign chart at \(1/2\) and \(1\) gives \(( -\infty,1/2]\cup(1,\infty)\).

\[(g\circ f)(x)=\frac1{\sqrt{x+2}-1}.\]

Require \(x\ge-2\) and \(\sqrt{x+2}\ne1\), which excludes \(x=-1\). Its domain is \([-2,-1)\cup(-1,\infty)\).

5. A rational inverse

If \(f(a)=f(b)\), cross multiplication is valid for \(a,b\ne-1\):

\[(2a-3)(b+1)=(2b-3)(a+1).\]

Expanding and rearranging gives \(5a=5b\), so \(f\) is one-to-one. Solving \(y=(2x-3)/(x+1)\) gives \(x=(y+3)/(2-y)\). The value \(y=2\) is impossible, because \(2(x+1)=2x-3\) would imply \(2=-3\). Every other real \(y\) yields an allowed \(x\), so the range is \(\mathbb R\setminus\{2\}\) and

\[f^{-1}(y)=\frac{y+3}{2-y},\qquad y\ne2.\]

Checking, \(f(f^{-1}(y))=(2(y+3)-3(2-y))/((y+3)+(2-y))=5y/5=y\) for \(y\ne2\).

6. Domain restriction

On \(\mathbb R\), \((-2)^2=2^2\), so the rule is not one-to-one. One choice is \(f:[0,\infty)\to[0,\infty)\), \(f(x)=x^2\). Its inverse is \(f^{-1}(y)=\sqrt y\), with domain \([0,\infty)\).

7. Transformations

The \(x+3\) shifts left 3. The negative sign reflects across the horizontal axis, the factor 2 stretches vertical distances by 2, and the \(+1\) shifts up 1. The vertex is \((-3,1)\) and the range is \(( -\infty,1]\).

8. What injectivity of a composition implies

If \(f(a)=f(b)\), applying \(g\) gives \(g(f(a))=g(f(b))\). Injectivity of \(g\circ f\) then gives \(a=b\). Thus \(f\) is one-to-one.

For the converse claim about \(g\), take \(A=[0,\infty)\), \(B=C=\mathbb R\), \(f(x)=x^2\), and \(g(t)=t^2\). Then \((g\circ f)(x)=x^4\) is one-to-one for \(x\ge0\), while \(g(-1)=g(1)\). Thus \(g\) need only be one-to-one on the image of \(f\).

9. Revenue, cost, and profit

\[\begin{aligned}P(q)&=R(q)-C(q)\\&=50q-(120+20q)\\&=30q-120.\end{aligned}\]

Hence \(P(10)=180\) dollars, and \(P(q)=0\) when \(q=4\). A reasonable domain is \(q\in\{0,1,2,\ldots\}\) if units are indivisible.

10. Invertible can still be sensitive

The cube function is strictly increasing, hence one-to-one. If a uniform c>0 existed, set y=0 and x=t>0. The inequality would say t³≥ct, or t²≥c, for every sufficiently small t; choosing 0<t<√c contradicts it. Thus its inverse, the cube-root function, has no uniform Lipschitz bound near zero. A small output perturbation around zero can produce a disproportionately large input change. By contrast, for g(x)=2x+1, |g(x)−g(y)|=2|x−y|, so c=2 and inverse errors are exactly half the output errors. This is a statement about mathematical sensitivity, not about the quality of a particular numerical algorithm.

Summary

Common mistakes: Confusing range with codomain; treating \(f^{-1}\) as a reciprocal; composing in the wrong order; losing domain exclusions after algebraic simplification; assigning a boundary point to the wrong piece.

What's next: Lesson M1.5 studies polynomial, rational, and root functions in more detail, including their graph behavior.