Find an anti-example of Clairaut's theorem Here is a quote from Calculus: Early Transcendentals written by James Stewart

Clairaut’s Theorem：Suppose $f$ is defined on a disk $D$ that contains the point $(a, b)$. If the functions $f_{xy}$ and $f_{yx}$ are both continuous on $D$, then $f_{xy} = f_{yx}$

Where
$$f_{xy} \equiv \frac{\partial}{\partial y} \left( \frac{\partial f}{\partial x} \right)$$
I don't know how to compose a function that $f_{xy}$ or $f_{yx}$ are not continuous on $(a, b)$. Can you give me an example?
 A: For example take
$$
f(x,y)= xy\frac{x^2-y^2}{x^2+y^2} \quad ((x,y)\not=(0,0)), \quad \quad f(0,0)=0.
$$
Here $f_x$ and $f_y$ both exist and are even continuous on $\mathbb{R}^2$, and
$$
f_{xy}(0,0)=-1,\quad f_{yx}(0,0)=1.
$$
The continuity of $f_x$ and $f_y$ in $(0,0)$ is a bit tricky, but it is easy to show that $f_x(0,y)=-y$ for all $y$ and $f_y(x,0)=x$ for all $x$.
Edit: You can see directly that $f_{xy}$ and $f_{yx}$ are not continuous in $(0,0)$. You have calculated
$$
f_{xy}(x,y)=f_{yx}(x,y)=\frac{x^6+9x^4y^2-9x^2y^4-y^6}{(x^2+y^2)^3} \quad ((x,y) \not= (0,0)).
$$
Inserting $(1/n,1/n)$ leads to $f_{xy}(1/n,1/n)= 0 \to 0$ $(n \to \infty)$. Inserting $(1/n,0)$ leads to $f_{xy}(1/n,0)= 1 \to 1$ $(n \to \infty)$. Thus $\lim_{(x,y)\to (0,0)} f_{xy}(x,y)$ does not exist.
A: Just pick any function which isn't continuous and integrate it twice.
For example, let $D=(-1,1)\times (-1,1)$. Consider
$$g(x,y)=\operatorname{sgn}(x)\operatorname{sgn}(y)$$
Which is not continuous on $D$. Now let
$$f(x,y)=\int_0^y\int_0^x g(x',y')\mathrm dx'\mathrm dy' \\ =\int_0^y\int_0^x \operatorname{sgn}(x')\operatorname{sgn}(y')\mathrm dx'\mathrm dy' \\ =\int_0^y|x|\operatorname{sgn}(y')\mathrm dy' \\ =|xy|$$
Note that $f$ is continuous on $D$.
