Solution (source code)

= Solution

Fix $(x,y)\in U$ and a sufficiently small rectangle inside $U$. Its rectangular increment
$$
\Delta=f(x+h,y+k)-f(x+h,y)-f(x,y+k)+f(x,y)
$$
can be evaluated twice using the <fundamental theorem of calculus>, giving
$$
\Delta=\int_x^{x+h}\int_y^{y+k}D_2D_1f(s,t)\,dt\,ds
=\int_y^{y+k}\int_x^{x+h}D_1D_2f(s,t)\,ds\,dt.
$$
Divide by $hk$ and let $h,k\to0$. Continuity of the <mixed partial derivatives> makes the two limits $D_2D_1f(x,y)$ and $D_1D_2f(x,y)$. \b[They are equal everywhere on $U$.]

Repeated interchange of adjacent <partial derivatives> reduces every order-$m$ <derivative> of a smooth function to $D_1^jD_2^{m-j}f$, $0\leq j\leq m$. Hence there are at most $m+1$ distinct functions. This maximum is attained by $f(x,y)=e^{x+2y}$, whose listed <partial derivatives> are the distinct functions $2^{m-j}e^{x+2y}$. The answer is \b[$m+1$], rather than the $2^m$ possible written orders.

For the supplied $f$, $f(t,t)=1/2$ for $t\ne0$, whereas $f(0,0)=0$. It is not even continuous at the origin, so \b[$f$ is neither differentiable nor infinitely differentiable there].

For $g$, $|g(x,y)|\leq|xy|\leq(x^2+y^2)/2$. Thus $g(x,y)=o(\sqrt{x^2+y^2})$, proving <Fréchet differentiability> at the origin with <derivative> zero. However,
$$
D_1g(0,y)=-y,\qquad D_2g(x,0)=x,
$$
including zero at the origin. Therefore $D_2D_1g(0,0)=-1$ and $D_1D_2g(0,0)=1$. \b[$g$ is differentiable but not infinitely differentiable at the origin]: it cannot have continuous second <partial derivatives> near that point.