<s>[INST] Solving a problem involving continuity of a piecewise function I'm trying to solve the following problem:

Determine which $n\in\mathbb{N}$ make the following function
  $f:\mathbb{R}^3\rightarrow \mathbb{R}$ continuous at the origin:
$   f(x,y,z)=\left\{
      \begin{array}{cr}
       
 \frac{(\cos^2\left(|x|+|y|\right)-1)\sin(y^2+z^2)}{(x^2+y^2+z^2)^{n/2}}
 & \text{if } (x,y,z) \neq 0\\
        0 & \text{if } (x,y,z) = 0\\
      \end{array}  \right. $

It's obvious that $f$ is continuous at the origin if $n\leq 2$, since:
$\left|\frac{(\cos^2\left(|x|+|y|\right)-1)\sin(y^2+z^2)}{(x^2+y^2+z^2)^{n/2}}\right|\leq\frac{|\cos^2\left(|x|+|y|\right)-1|\,|y^2+z^2|}{|x^2+y^2+z^2|}\leq\frac{|\cos^2\left(|x|+|y|\right)-1|\,|y^2+z^2|}{|y^2+z^2|}=|\cos^2\left(|x|+|y|\right)-1|\rightarrow 0$
I'm almost sure the function isn't continuous if $n> 2$ but I can't seem to find a way to prove it.
 [/INST] The question is for $n$ integer, but we can take $a\in\mathbb R$ instead of $n$. We denote $f_a$ the corresponding function. We have for $(x,y,z)\neq (0,0,0)$ 
$$f_a(x,y),z)=-\frac{\sin^2(|x|+|y|)\sin (y^2+z^2)}{(x^2+y^2+z^2)^{a/2}}.$$
Now, fix a real number $m$. We have 
$$f_a(x,mx,mx)=-\frac{\sin(2|mx|)\sin(2m^2x^2)}{(1+2m^2)^{a/2}|x|^a}\overset{0}{\sim}-\frac{4|m^3||x|^{3-a}}{(1+2m^2)^{a/2}},$$
hence $f_a$ cannot be continuous if $3-a\leq 0$ hence $a\geq 3$. Conversely, if $a<3$ we have thanks to then inequality $|\sin t|\leq |t|$:
\begin{align*}
|f_a(x,y,z)|&\leq\frac{(|x|+|y|)(y^2+z^2)}{(x^2+y^2+z^2)^{a/2}}\\
&\leq \sqrt 2\frac{\sqrt{x^2+y^2}(y^2+z^2)}{(x^2+y^2+z^2)^{a/2}}\\
&\leq \sqrt 2(x^2+y^2+z^2)^{\frac{3-a}2},
\end{align*}
and we can conclude since the exponent is positive.
</s>