Is $f$ differentiable and continuous at$ (0,0)$? We have $f: \mathbb{R}^2 \to \mathbb{R}$ definied by:
$f(x,y) =
\begin{cases}
x^2,  & \text{for $y \gt0$} \\
0, & \text{for $y =0$} \\
-x^2, & \text{for $y \lt0$} 
\end{cases}$
Is $f$  continuous and differentiable at $(0,0)$ ?
How do I do that with this function?
Thanks in advance! 
 A: I think it's clear that $f$ is continuous at $0$.
Now let's try and tackle differentiability.
Each half-plane $H_1=\{(x,y)\in\mathbb{R}^2\,|\, y>0\}$ and $H_2=\{(x,y)\in\mathbb{R}^2\,|\, y<0\}$ is an open set on which $f$ is clearly differentiable, with $\nabla f(x,y)=2x$ on $H_1$ and $\nabla f(x,y) = -2x$ on $H_2$.
Now, as $(x,y)\to (0,0)$, $\nabla f \to 0$ on both $H_1$ and $H_2$.
This hints us that $\nabla f=0$ at $(0,0)$.
Let's recall the definition.
A function $f:\mathbb{R}^m\longrightarrow \mathbb{R}^n$ is said to be differentiable at $x\in\mathbb{R}^m$ if there is some linear map $D_x:\mathbb{R}^m\longrightarrow\mathbb{R}^n$ such that
$$\lim_{h\to0}\,\frac{\lVert f(x+h)-f(x)-D_x(h)\rVert}{\lVert h \rVert}=0.$$
In our case we have $x=0$.
Let's try it with $D_x$ being the zero map $($following our suspicion from the calculations of $\nabla f)$.
We then need to check if
$$\lim_{(a,b)\to 0}\frac{|f(a,b)|}{\sqrt{a^2+b^2}}=0.$$
To that end, observe that
$$0\leq \frac{|f(a,b)|}{\sqrt{a^2+b^2}} = \frac{a^2}{\sqrt{a^2+b^2}}\leq \frac{a^2}{|a|}=|a|,$$
so that by the squeeze theorem as $(a,b)\to 0$ so too does $|f(a,b)|/\sqrt{a^2+b^2}$.
It follows from the definition that $f$ is differentiable at $x=0$ and its gradient at $x=0$ is $(0,0)$.
A: Any function $g(x,y)$ that satisfies $|g(x,y)|\le x^2 + y^2$ everywhere is differentiable at $(0,0),$ with $Dg(0,0)$ equal to the zero linear transformation. The proof is straightforward: Just check that
$$g(x,y)= g(0,0) + 0 + o((x^2+y^2)^{1/2}).$$
In our problem, we have $|f(x,y)|\le x^2 \le x^2+y^2,$ so by the above $Df(0,0)$ is the zero linear transformation.
