In my class I'm seeing the total derivative and the directional derivative and I wondered if there exists an example of a function $f$ so that $f$ is a function with $f:\mathbb{R^2}\mapsto \mathbb{R}$ so that in $(0,0)$ all the directional derivatives exist, but $f$ isn't continuous at $(0,0)$.
3 Answers
consider the following function: let $f:\mathbb{R}^{2}\rightarrow\mathbb{R}$ be
$f\left(x,y\right)=\begin{cases} 1 & \sqrt{x}<y<2\sqrt{x}\\ 0 & \text{else} \end{cases}$
the directional derivatives at $\left(0,0\right)$ are all equal to $0$, but f is not continous at $\left(0,0\right)$. you could verify those facts yourself, it is a good exercise.
Consider
$$ f(x,y) = \frac{xy^2}{x^2 + y^4}, (x,y) \not= (0,0) $$
And $f(0,0) = 0$
Let $v = (v_1,v_2)$ non-zero unitary then
$$ \lim\limits_{t \to 0} \frac{f(tv) - f(0)}{t} = \lim\limits_{t \to 0} \frac{t^2 v_1 v_2}{v_1^2 t^2 + v_2^4 t^4} = \lim\limits_{t \to 0} \frac{v_1 v_2}{ v_1^2 + t^2 v_2^4} = \frac{v_2}{v_1} $$
if $v_1 \not= 0$.
If $v_1 = 0$ then the limit is zero.
Anyway, the directional derivatives exist but the function is not continuous at $(0,0)$ since
$$ \lim\limits_{t \to 0} f(kt^2,t) = \lim\limits_{t \to 0} \frac{kt^4}{k^2 t^4 + t^4} = \frac{k}{k^2 + 1}. $$
Consider a pencil of horizontal lines through the origin (describing the plane $xy$). All directional derivatives exist and are zero, and the function is continuous at $(0,0)$.
Now displace every line vertically with a displacement that is a function of the angle. You keep the directional derivatives but lose the continuity.
A simple instance is
$$f(x,y)=\begin{cases}0, xy\ge0\\1,xy<0.\end{cases}$$