I make a big fuss that my calculus students provide a "continuity argument" to evaluate limits such as $\lim_{x \rightarrow 0} 2x + 1$, by which I mean they should tell me that $2x+1$ is a polynomial, polynomials are continuous on $(-\infty, \infty)$, and therefore $\lim_{x \rightarrow 0} 2x + 1 = 2 \cdot 0 + 1 = 1$.
All the examples they encounter where it is not correct to simply evaluate at $a$ when $x \rightarrow a$ fall into one of two categories:
- The function is not defined at $a$.
- The function is piecewise and expressly constructed to have a discontinuity at $a$.
I'd like to find a function $f$ with the following properties:
- $f(a)$ exists
- $f(a)$ is not (obviously) piecewise defined
- $f(x)$ is not continuous at $a$
- $f$ is reasonably familiar to a Calculus I student - trigonometry would be admissible, but power series would not (though they might still make for interesting reading)
A very easy way to construct a function that is piecewise without being "obviously piecewise" is functions defined in terms of limits:
$$f(x) = \lim_{a \to +\infty} \exp\left(-ax^2\right) = \begin{cases}1, & x = 0 \\ 0, & \text{otherwise}\end{cases}$$
This example has the advantage of being easily-comprehensible to beginning calculus students.