TITLE: Are linear functions always continuous?
QUESTION [5 upvotes]: I'm trying to clarify a definition for middle school mathematics students (grade 8) for "linear function." 
I have always viewed the NCTM (National Council of Teachers of Mathematics) definition of a linear functions as accurate: 
"a relationship whose graph is a straight line." 
A physicist and mathematics teacher is stating this definition is incorrect and says that linear functions can be discrete, as in an arithmetic sequence. 
Because my area of expertise is not higher-level maths, but I want to be accurate, I am asking for confirmation that a linear function is always continuous.

REPLY [2 votes]: The problem  here is that the NCTM's definition is not the same definition that is used by working mathematicians and physicists.  This does not mean that it is wrong; it is simply different, in deference to the level of the students.  The NCTM's definition is, perhaps, better stated as

Definition 1:  A function $f:\mathbb{R}\to\mathbb{R}$ is said to be linear if its graph is a straight line.

This is actually a perfectly reasonable definition.  Assuming the postulates of Euclidean geometry, two points determine a line.  So suppose that $(x_1,y_1)$ and $(x_2,y_2)$ are any two points on the graph of $f$, and further suppose that $(x,y)$ is any other arbitrary point on that line, as in the figure below (and interactive Desmos demo).

A line parallel to the $x$-axis through $(x_1,y_1)$ and a line parallel to the $y$-axis through $(x_2,y_2)$ determine a right triangle.  Dropping a second line parallel to the $y$-axis through $(x,y)$ determines a second right triangle which is similar to the original triangle.  By properties of similar triangles, we have
\begin{align}
\frac{y_2 - y_1}{x_2 - x_1} = \frac{y - y_1}{x - x_1}
 &\implies y-y_1 = \frac{y_2 - y_1}{x_2 - x_1}(x-x_1) \\
 &\implies y = \underbrace{\left(\frac{y_2 - y_1}{x_2 - x_1}\right)}_{=m} x + \underbrace{\left(y_1 - \left(\frac{y_2 - y_1}{x_2 - x_1}\right)x_1\right)}_{=b},
\end{align}
which gives the "usual" slope-intercept equation for a line.
So this definition is perfectly reasonable from a mathematical point of view, and is relatively simple for middle schoolers to understand.  Pedagogically, it makes a lot of sense.
The difficulty is that linearity is often defined differently in higher mathematics.  Specifically,

Definition 2: A function $f : X \to Y$ between vector spaces $X$ and $Y$ is linear if
$$ f(ax + by) = af(x) + bf(y), $$
for all scalars $a$ and $b$, and all vectors $x$ and $y$.  Such a function may also be called a linear map.

Note that this is different from the middle school definition of a linear function in two very important ways:  first, the definition applies to functions with arbitrary vector spaces for domain and codomain, rather than the real numbers; and second, a linear function must be zero at zero.  A function of the form
$$ f(x) = ax + b $$
is linear if and only if $b=0$ (though if $b\ne 0$, then $f$ is a translation of a linear function, and may be called an affine map).
It is worth noting that such a function is generally continuous,[1] though the intuition which we give to middle schoolers (i.e. a function is continuous if its graph can be drawn without lifting the pen) fails.  For example, it is impossible to draw the graph of a linear function (or any function, for that matter) from $\mathbb{Q}$ to $\mathbb{Q}$ without lifting one's pen.  This middle school definition of continuity doesn't generalize well—one really needs to introduce the notion of a topology (or, at least, epsilons and deltas) to properly describe continuity.  But this is entirely inappropriate for middle school. ;)

[1]  It should be noted that, in more general settings, a linear function needn't actually be continuous.  If $V$ is an infinite dimensional vector space over some field, then it may be possible to find linear functions (in the sense of Definition 2) which are not continuous.  For example, the space of all smooth, real-valued functions on $\mathbb{R}$ is an infinite dimensional vector space over $\mathbb{R}$.  The derivative operator (i.e. the function which takes a smooth function $f$ as input, and outputs $f'$) is linear, but not continuous.