In this section, we learn:
Definitions of Continuity and Discontinuity
Consider a function \(f\) whose graph is shown in the following figure. We can intuitively say that \(f\) is discontinuous at \(x=3,1,3\), and \(5\) and is continuous at any other points; we don’t have to lift the pen to draw the graph of \(f\) except when \(x=3,1,3,5\).

The function is discontinuous at \(x=3\) because it is not defined there.

The function has a jump discontinuity at \(x=1\); the lefthand limit is not equal to the righthand limit. Because \(\lim_{x\to1^{}}f(x)=f(1)\), we say the function is continuous from the left.

The function is not continuous at \(x=3\) because \(f(3)\) is not equal to the limit of the function as \(x\to3\). \[\lim_{x\to3}f(x)=1\neq f(3)=5\]

The function is discontinuous at \(x=5\) because \[\lim_{x\to5^{}}f(x)=3\neq f(5)=1.\] However, we intuitively say the function continuous at \(x=5\) because \[\lim_{x\to5^{+}}f(x)=f(5)=1.\] Because \(x=\pm5\) are endpoints of the domain of \(f\), only onesided limits exist.
Here is the formal definition of continuity.
Definition 1: The function \(f\) is continuous at \(a\) if \[\lim_{x\to a}f(x)=f(a)\]
It follows from the above definition that when the function \(f\) is continuous at \(a\) then

\(f\) is defined at \(a\).

\(\lim_{x\to a}f(x)\) exits (which requires that \(f\) to be defined on some open interval containing \(a\)).

\(\lim_{x\to a}f(x)=f(a)\)

When \(f\) is not continuous at \(a\) we say \(f\) is discontinuous at \(a\) or has a discontinuity at \(a\).
In a similar fashion, we can define left and right continuities.
Definition 2: The function \(f\) is leftcontinuous at \(a\) (or continuous from the left) if \[\lim_{x\to a^{}}f(x)=f(a)\] The function is rightcontinuous at \(a\) (or continuous from the right) if \[\lim_{x\to a^{+}}f(x)=f(a).\]

It follows from the definitions that the function \(f\) is continuous at \(x=a\) if and only if it is leftcontinuous and rightcontinuous at the point \(a\).

If a function is continuous at every \(x\) in an open interval \((a,b)\), we say it is continuous over \((a,b)\).

We say a function is continuous over a closed interval \([a,b]\) if it is continuous over the open interval \((a,b)\) and is leftcontinuous at \(a\) and rightcontinuous at \(b\).
Types of Discontinuity
1. Removable Discontinuity
We say that \(f\) has a removable discontinuity at \(x=a\) if \[\lim_{x\to a}f(x)=L,\] and either \(f\) is not defined at \(a\) or \(f(a)\neq L\). We can make \(f(x)\) continuous at \(x=a\), if \(L\) is assumed as the value of \(f(a).\)
Read More on Removable Discontinuity
For example, the function \[f(x)=\frac{x^{2}4}{x2}\] is not defined for \(x=2\) (because there would be division by zero), but for every other value of \(x\), \[f(x)=\frac{(x2)(x+2)}{x2}=x+2.\] Because \[\lim_{x\to2}(x+2)=4,\] we obtain \[\lim_{x\to2}\frac{x^{2}4}{x2}=4.\] Although the function is not defined when \(x=2\), if we arbitrarily assign \(f(x)\) the value 4 when \(x=2\) (that is, \(f(2)=4\)), then it becomes continuous at \(x=2\) (see Figure 3).
(a) $f(x)=\frac{x^{2}4}{x2}$ is discontinuous at $x=2$  (b) The discontinuity of $f$ at $x=2$ is removed if we define $f(x)=\begin{cases} \frac{x^{2}4}{x2} & x\neq2\\ 4 & x=2 \end{cases}$. 
Figure 3
2. Jump Discontinuity
We say \(f\) has a jump discontinuity at \(x=a\) if the right and left limits exist but have different values \[\lim_{x\to a^{}}f(x)\neq\lim_{x\to a^{+}}f(x).\]
Read More on Jump Discontinuity
For example, the Heaviside step function \(H(x)\) is defined as \[H(x)=\begin{cases} 1 & \text{if }x\geq0\\ 0 & \text{if }x<0 \end{cases}\] This function has a jump discontinuity at \(x=0\) because \[\lim_{x\to0^{}}H(x)=0\neq\lim_{x\to0^{+}}H(x)=1.\] We note that \(H(x)\) is right continuous at \(x=0\) because \(H(0)=\lim_{x\to0^{+}}H(x)=1\). (See Figure 4).
Figure 4: Graph of \(H(x)=\begin{cases} 1 & \text{if }x\geq0\\ 0 & \text{if }x<0 \end{cases}\) 
The greatest integer function (also known as the floor function) \(y=\left\lfloor x\right\rfloor\) (or $y=[\![ x]\!]$) has a jump discontinuity at every integer (see Figure 5). For example, \[\lim_{x\to2^{}}\left\lfloor x\right\rfloor =1\neq\lim_{x\to2^{+}}\left\lfloor x\right\rfloor =2.\]
Figure 5: Graph of \(y=\left\lfloor x\right\rfloor\) 
3. Infinite Discontinuity
We say \(f\) has an infinite discontinuity at \(x=a\) if one of the onesided limits or both of them are plus or minus infinity.
Read More on Infinite Discontinuity
For example, \(f(x)=1/x^{2}\) has an infinite discontinuity at \(x=0\) (See Figure 6). Note that we can choose a value for \(f(0)\) but we cannot make it continuous at \(x=0\) because \(\lim_{x\to0}f(x)=\infty\) and \(\infty\) is not a number to assign it to \(f(0)\).
Figure 6: Graph of \(f(x)=\dfrac{1}{x^{2}}\). 
4. Oscillating Discontinuity
Read More on Oscillating Discontinuity
For example, \(f(x)=\sin\left(\frac{1}{x}\right)\) oscillates between \(1\) and \(1\) infinitely often as \(x\to0\) (See the following figure). Because this function does not approach a single number, it does not have a limit as \(x\to0\).
Figure 7: Graph of \(f(x)=\sin\left(\dfrac{1}{x}\right)\). 
A function that is discontinuous at every point of its domain
Hide the example
Consider the Dirichlet function defined as \[D(x)=\begin{cases} 1 & \text{if }x\text{ is rational}\\ 0 & \text{if }x\text{ is irrational} \end{cases}\] This function is discontinuous at every point; \(D(x)\) fails to have a limit at any point.
Suppose \(D(x)\) has a limit \(L\) at a point \(a\). Suppose \(\epsilon=1/2\) is given, we should be able to find a \(\delta>0\) such that \[0<xa<\delta\impliesD(x)L<\frac{1}{2}\] Because each deleted neighborhood \(0<xa<\delta\) contains a rational point \(x_{1}\) and irrational point \(x_{2}\), we should have \[D(x_{1})L=1L<\frac{1}{2}\] and \[D(x_{2})L=0L<\frac{1}{2}\] and hence \[1=D(x_{1})L(D(x_{2})L)\leqD(x_{1})L+D(x_{2})L<\frac{1}{2}+\frac{1}{2}\] Because this is impossible, \(D(x)\) cannot have a limit.
Elementary Continuous Functions
Here are some elementary continuous functions

\(y=x^{n}\) where \(n\) is a positive integer is continuous everywhere.

Polynomials are continuous everywhere, because for any \(a\), \(\lim_{x\to a}P(x)=P(a)\)

Let \(P(x)\)and \(Q(x)\) be two polynomials and \(Q(a)\neq0\). Then the rational function \[R(x)=\frac{P(x)}{Q(x)}\] is continuous at \(x=a\). In other words, a rational function is continuous on their domains and is discontinuous at the points where the denominator is zero.

\(y=\sqrt[n]{x}\) where \(n\) is a positive odd integer is continuous everywhere.

\(y=\sqrt[n]{x}\) where \(n\) is a positive even integer is continuous on its domain \([0,\infty)\).

The sine and cosine functions are continuous on \(\mathbb{R}=(\infty,\infty)\).
Figure 8: \(y=\sin x\) and \(y=\cos x\) are continuous everywhere. 
Tangent, cotangent, secant and cosecant functions are continuous where they are defined; that is, on their domains. Specifically \(y=\tan x\) is continuous everywhere except where \(\cos x=0\); that is when \(x=\frac{\pi}{2}+k\pi\) for all integers \(k\). Thus \(y=\tan x\) is continuous on \[\left\{ x\Big\ x\neq\frac{\pi}{2}+k\pi,\quad k\in\mathbb{Z}\right\}\]
Figure 9: \(y=\tan x\) is continuous on its domain The graphs of the rest of trigonometric functions are illustrated in Figure . The domains of these functions are apparent from their graphs.
(a) \(y=\cot x\) (b) \(y=\sec x\) (c) \(y=\text{csc}x\) Figure 10

Inverse trigonometric functions are continuous on their domains. For example, \(y=\arcsin x\) and \(y=\arccos x\) are continuous on \([1,1]\)and \(y=\arctan x\) is continuous on \(\mathbb{R}=(\infty,\infty)\).

\(y=e^{x}\) is continuous on its domain \(\mathbb{R}=(\infty,\infty)\).

\(y=\ln x\) is continuous on its domain \((0,\infty)\).
In fact, most of the functions that we deal with in this course are continuous on their domains. Some exceptions are:

The greatest integer function (also known as the floor function) \(f(x)=\left\lfloor x\right\rfloor\) (or $y=[!\[x]!\]) which is discontinuous at every integer (although it is defined everywhere).
Graph of \(y=\left\lfloor x\right\rfloor\)

Piecewise defined functions are not necessarily continuous on their domains. For example, \[y=x=\begin{cases} x & \text{if }x\ge0\\ x & \text{if }x<0 \end{cases}\] is continuous everywhere but the sign function \(y=\text{sgn}(x)\) and the Heaviside step function \(y=H(x)\) are continuous everywhere except when \(x=0\). \[\text{sgn}(x)=\begin{cases} 1 & \text{if }x>0\\ 0 & \text{if }x=0\\ 1 & \text{if }x<0 \end{cases}\] \[H(x)=\begin{cases} 1 & \text{if }x\geq0\\ 0 & \text{if }x<0 \end{cases}\] [The Heaviside step function is rightcontinuous at \(x=0\)]
(a) \(y=x\) is continuous everywhere (b) \(y=\text{sgn}(x)\) is discontinuous at \(x=0\) (c) \(y=H(x)\) is discontinuous at \(x=0\) Figure 11
Algebraic Operations on Continuous Functions
Theorem 1: If the functions \(f\) and \(g\) are continuous at \(x=a\), and \(k\) is a number then the following functions are continuous at \(x=a\):
1. Sum \[f(x)+g(x)\] 2. Difference \[f(x)g(x)\] 3. Constant Multiple \[kf(x)\] 4. Product \[f(x)g(x)\] 5. Quotient \[\frac{f(x)}{g(x)}\qquad\text{provided }g(a)\neq0\] 6. Power \[\left(f(x)\right)^{n}\qquad n\text{ is a positive integer}\]
The results of the above theorem follow from the corresponding Limit Laws. For instance, to prove the sum property we have \[\begin{aligned} \lim_{x\to a}(f(x)+g(x)) & =\lim_{x\to a}f(x)+\lim_{x\to a}g(x)\\ & =f(a)+g(a)\end{aligned}\]
Continuity of Composite Functions
Theorem 2: If \(\lim_{x\to a}g(x)=b\) and \(f\) is continuous at the point \(b\), then \[\begin{aligned} \lim_{x\to a}f(g(x)) & =f(\lim_{x\to a}g(x))\\ & =f(b).\end{aligned}\]
Intuitively, the above theorem is plausible because \(\lim_{x\to a}g(x)=b\) means that when \(x\) is close to \(a\), \(g(x)\) is close to \(b\) and the continuity of \(f\)at the point \(b\) means that if the input (which is here \(g(x)\)) is close to \(b\), the output (which is here \(f(g(x))\)) is close to \(f(b)\).
Show the rigorous proof
Hide the rigorous proof
The mathematically rigorous proof is as follows. Let \(\epsilon>0\) be given. We need to find a number \(\delta>0\) such that for all \(x\) \[0<xa<\delta\Rightarrow\leftf(g(x))f(b)\right<\epsilon.\] Because \(f\) is continuous at \(b\), we have \[\lim_{y\to b}f(y)=f(b)\] and therefore, there exists a number \(\delta_{1}>0\) such that for all \(y\) \[yb<\delta_{1}\Rightarrowf(y)f(b)<\epsilon\] [Because \(f\) is continuous, we did not exclude \(y=b\) and wrote \(yb<\delta_{1}\) instead of \(0<yb<\delta_{1}\)].
Because \(\lim_{x\to a}g(x)=b\), there exists a \(\delta>0\) such that for all \(x\) \[0<xa<\delta\Rightarrowg(x)b<\delta_{1}\] If we let \(y=g(x)\), we can combine these two statements: For all \(x\) if \(0<xa<\delta\) then \(g(x)b<\delta_{1}\) which implies that \(\leftf(g(x))f(b)\right<\epsilon\). From the definition of limit, it follows that \[\lim_{x\to a}f(g(x))=f(b).\]

The theorem holds when \(a\) is an endpoint of the domain, provided we use an appropriate onesided limit in place of a twosided one.
Proof of the Root Rule from Sec. 4.4
Hide the proof of the root rule
We can use Theorem 2 to prove Theorem 5 from Section 4.4. Let assume \(\lim_{x\to a}g(x)\) and the indicated \(n\)th roots exist. Let \(f(x)=\sqrt[n]{x}\). In Section 4.4, we discussed that (see Theorem 4) \[\lim_{x\to a}f(x)=\lim_{x\to a}\sqrt[n]{x}=\sqrt[n]{a}\] That is, \(f(x)\) is continuous on its domain. Applying Theorem 2 which states that \[\lim_{x\to a}f(g(x))=f\left(\lim_{x\to a}g(x)\right)\] we obtain \[\lim_{x\to a}\sqrt[n]{g(x)}=\sqrt[n]{\lim_{x\to a}g(x)}.\]
It follows from Theorem 2 that
Theorem 3: If \(g\) is a continuous function at \(a\) and if \(f\)is continuous at \(g(a),\)then \(f\circ g\) is continuous at \(a\)
Show the proof
Hide the proof
To prove the above theorem, we need to show \[\lim_{x\to a}(f\circ g)(x)=(f\circ g)(a)\] or \[\lim_{x\to a}f(g(x))=f(g(a)).\] Because \(g\) is continuous at \(x=a\), then \[\lim_{x\to a}g(x)=g(a)\] and because \(f\) is continuous at \(g(a),\) by Theorem 2 \[\begin{aligned} \lim_{x\to a}f(g(x)) & =f\left(\lim_{x\to a}g(x)\right)\\ & =f(g(a)).\end{aligned}\]