Does this 3D function need to be symmetric for $\frac {\partial f(x,y)}{\partial x}= |\frac {\partial f(x,y)}{\partial y}|$ for all $x < y$? Suppose I have a 3D function $f(x,y):\mathbb {R^2_{\ge 0}} \to \mathbb {R_{\le0}}$ such that
$$
\frac {\partial f(x,y)}{\partial x}=
\begin{cases}
 >0&\text{if}\, x<y \\\
 0&\text{if}\, x=y\\
      <0&\text{if}\ x>y
\end{cases} 
$$
$$
\frac {\partial f(x,y)}{\partial y}=
\begin{cases}
 >0&\text{if}\, y<x \\\
 0&\text{if}\, y=x\\
      <0&\text{if}\ y>x
\end{cases} 
$$
$$
\frac {\partial^2 f(x,y)}{\partial x^2}<0$$
$$
\frac {\partial^2 f(x,y)}{\partial y^2}<0$$
The function's maximum is thus $0$, obtained at $x=y$, and is negative everywhere else. Suppose $x<y$. It is then given that $\frac {\partial f(x,y)}{\partial x}>0$ and $\frac {\partial f(x,y)}{\partial y}<0$
I would like to say $\frac {\partial f(x,y)}{\partial x}= |\frac {\partial f(x,y)}{\partial y}|$ for all $x < y$
In other words, that $f(x,y)$  will get equally closer to its maximum $0$ by a small shift in either direction (e.g., by increasing $x$ by a small amount to be closer to $y$ or decreasing $y$ by a small amount to be closer to $x$). The same principle applies to when $x>y$.
Two Questions:
1. Is symmetry a necessary or sufficient condition for this function? (e.g., as in the case $f(x) = x^2$, where $f'(x) = |f'(-x)|$).
2. If not, does this type of function have any special property?
 A: An example of a symmetrical solution is
$f(x,y)=-(x-y)^2$
(By symmetry here we always mean symmetry by the first diagonal, i.e. $f(x,y)=f(y,x)$).
However, symmetry is not a necessary condition.
Here is a polynomial example that meets all conditions, including $\frac {\partial f(x,y)} {\partial x} = |\frac {\partial f(x,y)} {\partial y}|$, but is not symmetrical.
We want it to be a polynomial in $z=x-y$.
To meet the required conditions, we'll use $(-z^2)$. Then we'll multiply it by something which is not symmetrical in $z$, and is always strictly positive. Let's take $z^2+z+1$, which has no real root.
So let $g(z)=-z^2(z^2+z+1)$,
and $f(x,y)=g(z)=-(x-y)^2((x-y)^2+x-y+1)$.
$f$ is $<0$ for $x\ne y$, and $=0$ for $x=y$.
To compute $\frac {\partial f(x,y)} {\partial x}$ and $\frac {\partial f(x,y)} {\partial y}$, we use the fact that $\frac {\partial z} {\partial x} = 1$ and $\frac {\partial z} {\partial y} = -1$.
$\frac {\partial f(x,y)} {\partial x} = g'(z) \frac {\partial z} {\partial x} = g'(z) = -z(4z^2+3z+2)$,
which is $<0$ for $z>0$, $=0$ for $z=0$, and $>0$ for $z<0$, so the conditions are met.
$\frac {\partial f(x,y)} {\partial y}=g'(z) \frac {\partial z} {\partial y}=-g'(z)$
$= -\frac {\partial f(x,y)} {\partial x}$, so the conditions are met too.
And we have $\frac {\partial f(x,y)} {\partial x} = |\frac {\partial f(x,y)} {\partial y}|$, which was the specific relation for which the question was raised.
$\frac {\partial^2 f(x,y)} {\partial x^2} = g''(z) \frac {\partial z} {\partial x} = g''(z)$
$=-12z^2-6z-2$, which is always $<0$, so the conditions are met.
$\frac {\partial^2 f(x,y)} {\partial y^2} = -g''(z) \frac {\partial z} {\partial y} = g''(z)$, so same as above, the conditions are met.
And $f$ is not symmetrical: $f(0,1)=-1, \; f(1,0)=-3$.
Second part: symmetry is not a sufficient condition either.
Let's have $f(x,y)=-(x-y)^2(x^2+2y^2)$ when $x \le y$, and $f(x,y)=f(y,x)$ when $x > y$.
$f$ is symmetrical.
On $x=y$: $f$ is continuous with value $0$; its partial derivatives are continuous with value $0$; its second derivatives are continuous too (as we'll see below).
For $x\lt y$, $\frac {\partial f(x,y)} {\partial x}=(x-y)(-4x^2+2xy-4y^2)$
This is $>0$, because $x-y < 0$ and $-4x^2+2xy-4y^2 = -(3x^2+3y^2+(x-y)^2) < 0$.
For $x\lt y$, $\frac {\partial f(x,y)} {\partial y}= (x-y)(2x^2-4xy+8y^2)$
This is $<0$, because $x-y<0$ and $2x^2-4xy+8y^2 = 2((x-y)^2+3y^2) > 0$.
For $x\lt y$, $\frac {\partial^2 f(x,y)} {\partial x^2} = -12x^2+12xy-6y^2$
$=-6((x-y)^2+x^2) < 0$.
For $x\lt y$, $\frac {\partial^2 f(x,y)} {\partial y^2} = -6x^2+24xy-24y^2$
$=-6((x-y)^2-2xy+3y^2) < 0$ because $y > x$ so $3y^2> 2xy$.
For $x > y$, $f$ being symmetrical, partial derivatives switch so the required conditions on $\frac {\partial f(x,y)} {\partial x}$, $\frac {\partial f(x,y)} {\partial y}$, $\frac {\partial^2 f(x,y)} {\partial x^2}$, $\frac {\partial^2 f(x,y)} {\partial y^2}$ are met.
$f$ second partial derivatives are continuous on $x=y$:
$\frac {\partial^2 f(x,y)} {\partial x^2}$ is $-6((x-y)^2+x^2)$ for $x<y$, and $-6((y-x)^2-2xy+3x^2)$ for $x>y$ (switching $x$ and $y$ in $\frac {\partial^2 f(x,y)} {\partial y^2}$ expression for $x<y$).
If we equate $x=y$ in these two expressions, we get $-6x^2$ for both, hence continuity.
However $\frac {\partial f(x,y)} {\partial x} \ne |\frac {\partial f(x,y)} {\partial y}|$:
$\frac {\partial f(x,y)} {\partial x} (0,1) = 4$,
$\frac {\partial f(x,y)} {\partial y} (0,1) = -8$.
