Proof differentiation from continuity Let $f$ be a function specified on the set $R ^ 3$ by the formula
(a) $f (x, y, z) = \begin {cases} x + y - z ^ 2 & \text {for} \quad z \in \mathbb{Q}, \\ x + y + z^4 & \text{ for} \quad z \in \mathbb{R} \setminus \mathbb{Q}. \end {cases}$
Prove that $ f $ has at the point $ a \in \mathbb{R}^3 $ the differential $ Df (a) $ if and only if $ f $ is continuous[latex] at $ a$.
I only know that I do not have to prove in the right direction (because it is known), but I do not know how I show myself in a different one for this function (something with partial derivatives ???)
 A: $\bullet\ $ Let $z \neq 0$, and $(x,y) \in \mathbb{R}$. Let's prove that $f$ is not continuous at $(x,y,z)$.
If $z \in \mathbb{Q}$, let $(z_n)_{n \geq 0}$ be a sequence of $\mathbb{R} \setminus \mathbb{Q}$ converging to $z$. Then $(x,y,z_n) \rightarrow (x,y,z)$, and $$f(x,y,z_n)=x+y+z_n^4 \longrightarrow x+y+z^4 \neq x+y-z^2 = f(x,y,z)$$
If $z \in \mathbb{R}\setminus \mathbb{Q}$, let $(z_n)_{n \geq 0}$ be a sequence of $\mathbb{Q}$ converging to $z$. Then $(x,y,z_n) \rightarrow (x,y,z)$, and $$f(x,y,z_n)=x+y-z_n^2 \longrightarrow x+y-z^2 \neq x+y+z^4 = f(x,y,z)$$
In both cases, $\displaystyle{\lim_{n \rightarrow +\infty} f(x,y,z_n) \neq f(x,y,z)}$, so $f$ is not continuous (hence, neither differentiable) at $(x,y,z)$.
$\bullet\ $ Let $(x,y) \in \mathbb{R}$. Let's prove that $f$ is differentiable at $a=(x,y,0)$. For every $(h,k,l)\in \mathbb{R}^3$ with $|l|\leq 1$, one has
$$\left|f(x+k, y+h, l)-f(x,y,0)-(k+h)\right|\leq |l|^2$$
so $$f(x+k, y+h, l)=f(x,y,0)+(k+h)+o(||(h,k,l)||)$$
so $f$ is differentiable (hence continuous) at $a=(x,y,0)$ (and $Df(a).(h,k,l)=h+k$).
