# Continuity of a function and it derivative

I am reading Burkill's "A Second Course in Mathematical Analysis". (On page 198) it says that

the existence of all directional derivatives at a point does not ensure continuity at that point.

But then on page 201, it says

If $X\subset \mathbb R^m$ and the function $f:X\to\mathbb R^n$ is differentiable at the interior point $\xi$ of $X$, then $f$ is continuous at $\xi$.

Can someone explain how these do not contradict? I am guessing the key pertains to the "existence of all directional derivatives" v.s. "differentiable"? Grateful if someone could point out the distinction.

Thanks.

-
Look for definition of 'directional derivatives' and of 'being differentiable'. They look similar but there is a great difference. If a function is differentiable at a point, there exists all directional derivates, but not the convese. –  rafaelm Nov 21 '11 at 11:44

Your guess is correct; given $X\subseteq \mathbb{R}^m$ and a function $f:X\to \mathbb{R}^n$, then $f$ is differentiable at $a\in\mathbb{R}^n$ when there is a linear transformation $L:\mathbb{R}^n\to\mathbb{R}^m$ such that $$\lim_{h\to 0}\frac{|f(a+h)-f(a)-L(h)|}{|h|}=0,$$ and when it exists, this $L$ is called $Df(a)$, the derivative of $f$ at $a$, and it is unique. If $m=1$ (i.e. the codomain of $f$ is $\mathbb{R}$), then the directional derivative of $f$ at $a\in\mathbb{R}^n$ in the direction of $x\in\mathbb{R}^n$ is $$\lim_{t\to 0}\frac{f(a+xt)-f(a)}{t}.$$ The differentiability of $f$ at $a$ implies the existence of all directional derivatives at $a$, but not conversely. However, if one assumes that there is an open set $U\subseteq \mathbb{R}^n$ containing $a$ such that all directional derivatives of $f$ exist everywhere in $U$, and the directional derivatives are continuous at $a$, then we are guaranteed that $Df(a)$ exists (this is Theorem 2-8 in Spivak's Calculus on Manifolds).
Thus, if we want a counterexample, we should look for functions whose directional derivatives are either not defined, or not continuous, at or around the point $a$. The classic example is the characteristic function of $$A=\{(x,y)\in\mathbb{R}^2\mid x>0,\;\;0<y<x^2\},$$ i.e. the function $f$ that is defined by $f(x)=1$ if $x\in A$ and $f(x)=0$ if $x\notin A$. Intuitively, one can see that all directional derivatives of $f$ exist at the origin $(0,0)$, because in any straight direction from the origin, there is some initial distance one can travel in which one is not in $A$, so all the directional derivatives of $f$ exist at $(0,0)$ and are equal to $0$. However, the limit defining the derivative $Df(0,0)$ "can see all paths" to the origin, including those that remain contained inside $A$ all the way there. Even though all the directional derivatives of $f$ exist and are continuous at $(0,0)$, the directional derivatives of $f$ do not exist at any other points along the boundary of $A$, and any neighborhood of the origin must contain some of those boundary points.
Note that, even if it were true that the existence of all partial derivatives at a point guaranteed the existence of the derivative at that point, the set of points where all the partial derivatives of $f$ exists is $A\cup \text{int}(A^c)\cup\{(0,0)\}$, and $(0,0)$ is not an interior point of that set.