Find weak derivative of sign-like function Let $f:\mathbb{R}^2\to \mathbb{R}$ be a function defined as follows. $$f(x,y)=\begin{cases} 1, &\text{if } x>y\\
-1,&\text{if } x<y.
\end{cases}$$
To compute the weak derivative $f_x$ of $f$, I proceeded as follows.
Assume $w$ be a weak derivative of $f$ in the sense of distribution. By definition of weak derivative, we have
$$\int_{\mathbb{R}^2}f(x,y)\,\varphi_x\,\mathrm dx\,\mathrm dy=-\int_{\mathbb{R}^2}w\,\varphi \,\mathrm dx\,\mathrm dy.$$
After a computation, the LHS becomes
$$\int_{\mathbb{R}^2}f(x,y)\,\varphi_x\,\mathrm dx\,\mathrm dy = -2\int_{\mathbb{R}}\varphi(y,y)\,\mathrm dy.$$
Then
$$\int_{\mathbb{R}^2}w\,\varphi \,\mathrm dx\,\mathrm dy=2\int_{\mathbb{R}}\varphi(y,y)\,\mathrm dy.$$
It looks like $w$ is related to Dirac delta distribution, but I don't know how to get an explicit formula for $w$.
Any help would be appreciated.

You were almost there!
Just remark that using the definition of $\delta_0(x-y) = \delta_y(x)$ gives
$$
\int_{\Bbb R} \varphi(y,y)\,\mathrm dy = \int_{\Bbb R} \left(\int_{\Bbb R}\varphi(x,y) \, \delta_y(x) \,\mathrm dx\right)\mathrm dy
\\
\qquad= \int_{\Bbb R^2} \varphi(x,y) \, \delta_0(x-y) \,\mathrm dx\,\mathrm dy = \langle\delta_0(x-y),\varphi\rangle
$$
and so you just proved that $f_x = 2\,\delta_0(x-y)$.
