Continuity is a property of functions from one space to another. In the case of a function f;R->R from the real line to the real line, we say that f is continuous at x0if for all x near x0, the value f(x) is near f(x0).
To get an idea of what we mean by continuity, we consider some examples where this property fails. The simplest is called a jump discontinuity. Let f:R->R be defined by f(x) = 1 if x not equal to 0 and f(0) = 0. Then for x not equal to 0, we have |f(x) - f(0)| = 1 so it is impossible to make this difference smaller than 1 no matter how near we stay to the point x = 0.
In this example, it is possible to redefine the value of f(0) so as to make the function continuous. Letting f(0) = 1 leads to the constant function f(x) = 1 for all x, and this will be continuous no matter what definition we choose to use.
A more complex kind of discontinuity occurs in the signum function, defined by the condition sgn(x) = -1 if x < 0. sgn(x) = 1 if x > 0, and sgn(0) = 0. As in the previous case, if x is not equal to zero, then |sgn(x) - sgn(0)| = 1, so it is impossible to make this difference small by restricting the domain of x near 0. Moreover it is impossible to change the definition of f(0) so as to make the function continuous at x = 0. If x is any positive number, then either |f(x)-f(0)| or |f(-x)-f(0)| will be greater than 1, so once again we cannot make the difference small by restricting x to lie in a small interval about zero.
In the first example above, the right-hand limit and the left-hand limit both exist and are equal. Only if f(0) equals this common value will the function be continuous at 0. In the second example, the right- and left-hand limits both exist, but they are unequal so it is not possible to define f(0) to be their common value. In general,we say that a function of one variable is continuous at a point if the right- and left-hand limits both exist and are equal to the value of the function at the point.
There are other ways for a function to be discontinuous at a point. One occurs where one or both of the onte-sided limits fail to exist. For the function f(x) = 1/(x^2) when x is not equal to zero, there is not (finite) value of f(0) that will make the function continuous at 0, since |f(x)-f(0)| will become arbitrarily large as x gets nearer and nearer to 0.
Even if f is a bounded function, it is possible that the right-hand limit will not exist at 0. The standard example of this phenomenon occurs for the function f(x) = sin(1/x) for x not equal to zero. This function has value 1 for infinitely many values of x arbitrarily close to x = 0, at all x = 1/[ pi/2 + 2pi k] for positive integers k, and there are also infinitely many x = 1/[3 pi/2 + 2pi k] for which f(x) = -1. Thus no matter how we define f(0), there are values of x arbitrarily close to 0 for which |f(x)-f(0)| > 1.
This last example is very important since it provides a number of counterexamples to otherwise plausible conjectures. Consider the function f(x) = x sin(1/x) for x not equla to 0 and f(0) = 0. It is not hard to show that this function is continuous at 0, since |f(x)-f(0)| = |x sin(1/x) - 0| = |x| |sin(1/x)| < |x| and the limit of |x| as x approaches 0 is 0. However this function is not differentiable at 0 since |f(x)-f(0)|/|x-0| = |sin(1/x)| does not approach a limit as x approaches 0.
The function f(x) = x^2 sin(1/x) for x not equal to 0 and f(0) = 0 is differentiable at 0, since |f(x)-f(0)|/|x-0| = |x sin(1/x)| which approaches 0 as x approaches 0. The function is differentiable for all other x just by the chain rule: f'(x) = 2 x sin(1/x) + x^2 (-1/x^2)cos(1/x)) = 2 x sin(1/x) - cos(1/x). But this last function is not continous at 0 for the same reasons that sin(1/x) is not continuous there. Therefore we have found an example of a differentiable function for which the derivative function is not continous. Such examples will become very important in the study of continuity for functions of more than one variable.