In short
If f and g are continuous at a point, then f + g, f - g, f \cdot g, and f/g (where g \neq 0) are all continuous there. A continuous function of a continuous function — the composite f \circ g — is also continuous. These rules, together with the fact that polynomials, trigonometric, exponential, and logarithmic functions are continuous on their domains, let you determine the continuity of almost any function you will encounter without checking limits from scratch.
You know how to check continuity at a single point: verify that the limit equals the function value. But for a function like
are you really going to compute \lim_{x \to a} h(x) from scratch at every point? That would be brutal. There is a better way.
The function h is built from simpler pieces — e^x, \sin x, x^2 + 1 — using multiplication and division. If you know that each piece is continuous, and you know that multiplication and division preserve continuity, then you can conclude that h is continuous without computing a single limit.
That is the idea behind the algebra of continuous functions: a set of rules that tell you how to build continuous functions from continuous building blocks. They are the continuity analogues of the limit laws you already know.
The algebra of continuous functions
Suppose f and g are both continuous at x = a. The following functions are also continuous at x = a:
Algebra of continuous functions
If f and g are continuous at x = a, then:
- Sum: f + g is continuous at a.
- Difference: f - g is continuous at a.
- Scalar multiple: k \cdot f is continuous at a, for any constant k.
- Product: f \cdot g is continuous at a.
- Quotient: f/g is continuous at a, provided g(a) \neq 0.
The proofs are short and clean. Each one follows directly from the corresponding limit law.
Proof of the sum rule
You need to show: if \lim_{x \to a} f(x) = f(a) and \lim_{x \to a} g(x) = g(a), then \lim_{x \to a} [f(x) + g(x)] = f(a) + g(a).
By the sum law for limits:
The first equality uses the fact that the limit of a sum is the sum of the limits (this is the limit sum law, proved in the article on algebra of limits). The second equality uses the assumption that f and g are continuous at a.
The right-hand side, f(a) + g(a), is exactly (f + g)(a). So \lim_{x \to a} (f + g)(x) = (f + g)(a). That is the definition of continuity for f + g at a.
Proof of the product rule
By the product law for limits:
Again, one line. The limit of a product is the product of the limits, and the limits equal the function values by continuity.
Proof of the quotient rule
By the quotient law for limits (valid when the denominator's limit is nonzero):
This requires g(a) \neq 0. If g(a) = 0, the quotient f/g is not defined at a, and the question of continuity does not arise (condition 1 of continuity fails).
The proofs for the difference and scalar multiple follow the same pattern — apply the corresponding limit law, then use continuity.
What this means in practice
Once you know a few base functions are continuous, the algebra rules let you bootstrap your way to almost any function.
Start with the simplest: the function f(x) = c (a constant) is continuous everywhere. The function g(x) = x (the identity) is continuous everywhere. Now use the product rule: x \cdot x = x^2 is continuous. Then x^2 \cdot x = x^3 is continuous. By induction, x^n is continuous for every positive integer n. The scalar multiple rule gives you a_n x^n for any coefficient a_n. The sum rule gives you a_n x^n + a_{n-1} x^{n-1} + \cdots + a_0 — any polynomial.
So every polynomial is continuous everywhere, proved from two trivial base cases and three algebra rules. No limits computed.
Composite of continuous functions
The algebra rules cover addition, subtraction, multiplication, and division. But there is a fifth way to combine functions: composition. Given f and g, the composite f \circ g is defined by (f \circ g)(x) = f(g(x)) — first apply g, then apply f to the result.
Continuity of composites
If g is continuous at x = a, and f is continuous at g(a), then the composite f \circ g is continuous at x = a.
Proof
You need to show that \lim_{x \to a} f(g(x)) = f(g(a)).
Since g is continuous at a, as x \to a you have g(x) \to g(a). Now let u = g(x). As x \to a, u \to g(a). Since f is continuous at g(a), as u \to g(a) you have f(u) \to f(g(a)). Therefore f(g(x)) \to f(g(a)) as x \to a.
That is the full proof. It says: if the inner function lands you near g(a), and the outer function is continuous at g(a), then the composite lands you near f(g(a)). The chain of closeness holds.
How this is used
The composite rule is what lets you handle expressions like \sin(x^2), e^{3x+1}, or \sqrt{x^2 + 5} without checking limits.
Take h(x) = \sin(x^2). This is the composite of f(u) = \sin u (continuous everywhere) with g(x) = x^2 (continuous everywhere). Since both are continuous everywhere, h = f \circ g is continuous everywhere.
Take h(x) = e^{\cos x}. The inner function \cos x is continuous everywhere, and the outer function e^u is continuous everywhere. So e^{\cos x} is continuous everywhere.
Take h(x) = \ln(x^2 - 3). The inner function g(x) = x^2 - 3 is continuous everywhere. The outer function f(u) = \ln u is continuous for u > 0. So the composite is continuous wherever x^2 - 3 > 0, i.e., wherever |x| > \sqrt{3}. At x = \pm\sqrt{3}, the argument of \ln is zero, and \ln is not defined at 0, so the function is not continuous there.
Continuity of standard functions
With the algebra and composition rules, continuity of complex functions reduces to knowing which basic functions are continuous and on what domains. Here is the catalogue.
| Function | Continuous on | Notes |
|---|---|---|
| c (constant) | (-\infty, \infty) | The simplest case |
| x^n, n a positive integer | (-\infty, \infty) | Follows from the product rule |
| Any polynomial p(x) | (-\infty, \infty) | Sum of continuous terms |
| \dfrac{p(x)}{q(x)}, rational function | Wherever q(x) \neq 0 | Quotient rule |
| \sin x, \cos x | (-\infty, \infty) | Proved from the limit \lim_{h \to 0} \frac{\sin h}{h} = 1 |
| \tan x | x \neq (2k+1)\frac{\pi}{2} | \sin x / \cos x; breaks where \cos x = 0 |
| e^x | (-\infty, \infty) | Continuous and positive everywhere |
| \ln x | (0, \infty) | Continuous on its domain |
| \sqrt{x} | [0, \infty) | Right-continuous at x = 0 |
| |x| | (-\infty, \infty) | Continuous everywhere (no break at 0) |
Every function you build from these using sums, products, quotients, and compositions is continuous on the intersection of the domains where each building block is continuous and well-defined. That covers nearly everything in the school syllabus.
Worked examples
Example 1: Continuity of a quotient involving trigonometric functions
Determine where h(x) = \dfrac{\sin x}{1 + \cos x} is continuous.
Step 1. Identify the building blocks.
The numerator is \sin x — continuous everywhere. The denominator is 1 + \cos x — a sum of continuous functions, hence continuous everywhere.
Why: the sum rule gives continuity of 1 + \cos x from the continuity of the constant 1 and \cos x.
Step 2. Apply the quotient rule.
h(x) is continuous wherever the denominator is nonzero: 1 + \cos x \neq 0, i.e., \cos x \neq -1.
Why: \cos x = -1 when x = (2k+1)\pi for integer k — that is, at x = \pm\pi, \pm 3\pi, \pm 5\pi, \ldots
Step 3. Verify at a specific point. Take x = \pi/2.
The denominator is 1 \neq 0, so the quotient rule applies and h is continuous at x = \pi/2.
Why: this confirms the general rule with a concrete check. At x = \pi/2, there is no issue.
Step 4. Examine a discontinuity point. Take x = \pi.
The denominator is zero. So h(\pi) is undefined, and h has a discontinuity at x = \pi.
Why: the quotient rule's hypothesis (g(a) \neq 0) fails, so the conclusion does not hold.
Result: h(x) = \dfrac{\sin x}{1 + \cos x} is continuous for all x \neq (2k+1)\pi, where k is any integer. At those points, the denominator vanishes and the function is undefined.
The graph shows the function blowing up at x = \pm\pi — infinite discontinuities where the denominator goes to zero. Between those asymptotes, the function is a smooth, unbroken curve.
Example 2: Continuity of a composite function
Determine where h(x) = \sqrt{4 - x^2} is continuous.
Step 1. Decompose as a composite.
Let g(x) = 4 - x^2 (inner function) and f(u) = \sqrt{u} (outer function). Then h(x) = f(g(x)).
Why: breaking the function into a chain of simpler functions is the first move whenever you see a composition.
Step 2. Determine where each piece is continuous.
g(x) = 4 - x^2 is a polynomial — continuous everywhere. f(u) = \sqrt{u} is continuous on [0, \infty).
Why: the square root is only defined for nonnegative inputs, and it is continuous on its entire domain (including right-continuity at u = 0).
Step 3. Apply the composite rule.
h = f \circ g is continuous wherever g is continuous and g(x) falls in the domain of f. That means g(x) \geq 0, i.e., 4 - x^2 \geq 0, i.e., x^2 \leq 4, i.e., -2 \leq x \leq 2.
Why: the composite rule requires f to be continuous at g(a). Since f = \sqrt{u} is only continuous for u \geq 0, we need g(a) \geq 0.
Step 4. Check the endpoints.
At x = 2: g(2) = 0, and \sqrt{0} = 0. The function is right-continuous at u = 0, and g approaches 0 from above as x \to 2^-, so h is left-continuous at x = 2. Similarly, h is right-continuous at x = -2.
Why: at the endpoints of [-2, 2], only one-sided continuity is needed, and it holds.
Result: h(x) = \sqrt{4 - x^2} is continuous on the closed interval [-2, 2].
The graph is a semicircle of radius 2. It is a single unbroken arc from (-2, 0) to (2, 0). The continuity of h on the closed interval [-2, 2] is exactly the statement that this semicircle has no gaps.
Piecewise continuity
Many functions in practice are defined by different formulas on different parts of the domain — especially in competitive exam problems, where piecewise functions are a favourite testing ground for continuity. A piecewise function is continuous if two things hold: each piece is continuous on its own interval, and the pieces join properly at the boundaries.
Consider the function:
Each piece is a polynomial, so each piece is continuous on its own interval. The only question is: do they agree at the boundary x = 1?
From the left: \lim_{x \to 1^-} x^2 = 1.
From the right: \lim_{x \to 1^+} (2x - 1) = 1.
Function value: f(1) = 1^2 = 1 (using the first piece, since x \leq 1).
All three match. So f is continuous at x = 1, and therefore continuous everywhere.
Now change the second piece to 2x:
From the left: \lim_{x \to 1^-} x^2 = 1.
From the right: \lim_{x \to 1^+} 2x = 2.
The one-sided limits disagree (1 \neq 2), so the function has a jump discontinuity at x = 1.
The general recipe for checking a piecewise function:
- Verify that each piece is continuous on its own interval (usually automatic if each piece is a standard function).
- At each boundary point, compute the left-hand limit (from the piece on the left), the right-hand limit (from the piece on the right), and the function value (from whichever piece is defined there).
- All three must be equal for continuity.
Continuity of the greatest integer and fractional part functions
The greatest integer function \lfloor x \rfloor is constant between consecutive integers and jumps by 1 at each integer. It is continuous on every interval (n, n+1) for integer n, and has a jump discontinuity at every integer. At each integer n: \lim_{x \to n^-} \lfloor x \rfloor = n - 1 and \lim_{x \to n^+} \lfloor x \rfloor = n = f(n). Since the left limit (n-1) does not equal the function value (n), the function is not left-continuous at integers.
The fractional part function \{x\} = x - \lfloor x \rfloor behaves similarly. Between integers, \{x\} is just x - n on the interval [n, n+1), which is a straight line from 0 (inclusive) to 1 (exclusive). At each integer, the function resets from just below 1 back down to 0: \lim_{x \to n^-} \{x\} = 1 but \{n\} = 0. So \{x\} has a jump discontinuity at every integer, with a jump size of 1.
Continuity of the sign function
The sign function \text{sgn}(x) equals -1 for x < 0, 0 for x = 0, and +1 for x > 0. It is constant (and therefore continuous) on (-\infty, 0) and on (0, \infty). At x = 0: \lim_{x \to 0^-} \text{sgn}(x) = -1 and \lim_{x \to 0^+} \text{sgn}(x) = +1. The one-sided limits are different, so there is a jump discontinuity of size 2 at the origin.
Finding the value of k that makes a function continuous
A very common exam problem: given a piecewise function with an unknown constant k, find the value of k that makes the function continuous.
Take:
For f to be continuous at x = 0, you need k = \lim_{x \to 0} \dfrac{\sin 3x}{x}.
Compute the limit. Write \dfrac{\sin 3x}{x} = 3 \cdot \dfrac{\sin 3x}{3x}. As x \to 0, 3x \to 0, and \dfrac{\sin 3x}{3x} \to 1 (the standard limit). So \lim_{x \to 0} \dfrac{\sin 3x}{x} = 3.
Therefore k = 3 makes f continuous at x = 0. Any other value of k creates a removable discontinuity.
This technique generalises: to make a piecewise function continuous at a boundary, compute the limit from both sides and set k equal to the common limit. If the two one-sided limits disagree, no value of k can rescue the function — the discontinuity is a jump, not removable.
Common confusions
-
"The sum of two discontinuous functions is always discontinuous." False. Take f(x) = \lfloor x \rfloor (discontinuous at integers) and g(x) = \{x\} = x - \lfloor x \rfloor (also discontinuous at integers). Their sum is f(x) + g(x) = \lfloor x \rfloor + x - \lfloor x \rfloor = x — continuous everywhere. Two discontinuous functions can "cancel out" each other's jumps.
-
"Continuity of f and g implies continuity of f/g everywhere." Only where g \neq 0. At points where g(a) = 0, the quotient is undefined. The quotient rule has a hypothesis — check it.
-
"f(g(x)) is continuous wherever f and g are both continuous." Almost right, but the condition is more precise. You need g to be continuous at a, and f to be continuous at the specific point g(a). If g(a) is outside the domain of f, the composite is not even defined.
-
"|f(x)| is continuous wherever f is continuous." This one is true. The absolute value function |u| is continuous everywhere, so |f(x)| is a composite of continuous functions. But the converse is false: |f(x)| can be continuous at a point where f(x) is not. For instance, f(x) = 1 for x \geq 0 and f(x) = -1 for x < 0 has a jump at x = 0, but |f(x)| = 1 everywhere — continuous.
Going deeper
If you can determine the continuity of functions using the algebra rules, the composite rule, and the standard-function table, you have the tools this article set out to give you. The rest is for readers who want the formal proofs connecting these properties to the epsilon-delta definition, and a look at what lies beyond.
Why the proofs work: the limit laws
Every proof in the "algebra of continuous functions" section was one line long. Each line appealed to a limit law (sum law, product law, quotient law). Those limit laws are themselves proved from the epsilon-delta definition. The full chain is:
If you trace the product rule all the way down, the proof goes like this: given \varepsilon > 0, you need |f(x)g(x) - f(a)g(a)| < \varepsilon. Write this as
Since f is continuous at a, f is bounded near a — say |f(x)| \leq M for x near a. Then you can make the first term less than \varepsilon/2 by making |g(x) - g(a)| less than \varepsilon/(2M) (using continuity of g), and the second term less than \varepsilon/2 by making |f(x) - f(a)| small enough (using continuity of f). The two \varepsilon/2's add to \varepsilon.
This is the standard \varepsilon/2-trick in analysis. It is not hard, but it is careful — the kind of careful that turns "obviously true" into "provably true."
Continuity and differentiability
Every differentiable function is continuous. If f'(a) exists, then \lim_{x \to a} f(x) = f(a) — continuity at a follows from differentiability at a. The proof is short:
As x \to a, the first factor approaches f'(a) (by the definition of the derivative) and the second factor approaches 0. So the product approaches f'(a) \cdot 0 = 0, which means f(x) \to f(a).
The converse is false. The function f(x) = |x| is continuous at x = 0 but not differentiable there — the graph has a sharp corner. Continuity is necessary for differentiability, but not sufficient. This distinction is fundamental to the structure of calculus.
Uniform continuity: a stronger condition
Ordinary continuity says: for each point a and each \varepsilon > 0, there exists a \delta > 0. The \delta is allowed to depend on which point a you are at. Uniform continuity demands more: a single \delta must work for all points simultaneously.
A key theorem: every function that is continuous on a closed interval [a, b] is automatically uniformly continuous on that interval. This is the Heine-Cantor theorem. It explains why closed intervals are so important in analysis — they give you uniform continuity for free.
On an open interval, uniform continuity can fail. For instance, f(x) = 1/x is continuous on (0, 1) but not uniformly continuous there — near x = 0, the function changes faster and faster, and no single \delta can keep up.
Where this leads next
- Continuity — Introduction — the foundational article: what continuity means at a point and on an interval.
- Types of Discontinuity — the four ways continuity can fail, classified and illustrated.
- Composite Functions — the detailed study of function composition, which the continuity composition rule builds on.
- Derivative — the next major concept, which requires continuity as a prerequisite.
- Algebra of Limits — the limit laws that underpin every proof in this article.
- Special Functions: Part 1 — the floor function, fractional part, and sign function in detail, including their continuity and discontinuity behaviour.