Nonpiecewise Function Defined at a Point but Not Continuous There 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, &amp; x = 0 \\ 0, &amp; \text{otherwise}\end{cases}$$

This example has the advantage of being easily-comprehensible to beginning calculus students.
An interesting example of "natural discontinuity" that I know, is easy to absorb on any level and it comes from classical textbooks. It requires some basic imagination, however.

Textbooks usually start from defining the function, and then ask a student to prove some technical stuff about it. I prefer to start from the other way around.

Consider $(x,y,z)$-space. Take both $x$- and $y$- axes and exclude the origin. We want our function to go through them, so that whenever $x$ or $y$ equals $0$, $z$ equals $0$ as well.

Now, consider the diagonals $x+y=0$ and $x-y=0$ lifted above $(x,y)$-plane to $z=1$, and exclude the lifted origin $(0,0,1)$ from this construction. What happens if we want our continuous everywhere except for the origin function to go through these lines as well?

To help imagine that. A bisection by any vertical plane $y=c\neq0$ should be a continuous M-shaped function going through $(x,z)=(0,0)$ as well as $(x,z)=(\pm c,1)$. The closer is $c$ to $0$, the closer are the last two points to each other. Similarly, with bisection by any vertical $x$-plane.

When you move to origin from north, east, south or west along $x=0$ or $y=0$ you are always at the bottom of this "canyon" at sea-level height of $z=0$. However, when you are on one of the two diagonals moving, for example, from north-east, you are always on top of the range at height $z=1$.

Interestingly enough, such a function can be easily defined, for example, as follows: $$\frac{x^2y^2}{x^4+y^4},(x,y)\in\mathbb{R}-\{(0,0)\}$$

Now, without specifying the value at $(0,0)$ what should it be? Depending on what direction you are coming from, it can be any value within the whole interval. But in any case it will remain discontinuous.