Finding the weak derivatives:
a/ $f(x)=\left|x_1 \right|$, for all $x=(x_1,\ldots, x_n)$;
b/ $f(x)=\operatorname{sign} (x_1)$, where $\Omega=\{\left|x \right|<1\}$.
==========================================
We know that $f$ has weak derivative $\partial^\alpha f=g$ if $$\int_{\Omega}g \varphi \ \mathrm{d}x=(-1)^\left|\alpha \right|\int_{\Omega}f\cdot D^\alpha \varphi \ \mathrm{d}x, \ \forall \varphi \in C_{0}^{\infty}(\Omega)$$
==========================================
For Question a/ We assume that $g$ is the weak devirative of $f$.
We have $I:=\int_{-1}^{1}g\varphi \ \mathrm{d}x=-\int_{-1}^{1}|x_1|D\varphi \ \mathrm{d}x_1, \ \forall \varphi \in C_{0}^{\infty}(\Omega) \tag 1$
Whence $-I=\int_{-1}^{0}-x_1 D\varphi \ \mathrm{d}x_1+\int_{0}^{1}x_1 D\varphi \ \mathrm{d}x_1=-x_1\varphi \mid_{-1}^{0}+\int_{-1}^{0}\varphi \ \mathrm{d}x_1+x_1 \varphi \mid_{0}^{1}-\int_{0}^{1}\varphi \ \mathrm{d}x_1$
Hence, $$\begin{align*} -I&=\varphi(1)-\varphi(-1)-\left(\int_{0}^{1}\varphi \ \mathrm{d}x_1-\int_{-1}^{0}\varphi \ \mathrm{d}x_1 \right)\\ &=\varphi(1)-\varphi(-1)-\int_{-1}^{1}\operatorname{sign} (x_1) \varphi \ \mathrm{d}x_1 \\ &=-\int_{-1}^{1}\operatorname{sign} (x_1) \varphi \ \mathrm{d}x_1 \tag 2 \end{align*} $$
Since (1) and (2), we have $g(x)=\operatorname{sign} (x_1) \blacksquare$
========================================
Now, For Question b/ I have stuck when I trying to show that $\not \exists$$g$ is the weak devirative of $f$.
Can anyone solve it? Thanks!
For (b), just start as in (a), for $\phi \in C^\infty_c(\Omega)$, for $n=1$ (you do (a) also for $n=1$ and one can see the basic idea in this case) \begin{align*}\def\s{\mathop{\rm sign}}\def\abs#1{\left|#1\right|} -\int_{\Omega} \s{x_1}\cdot\phi'\, dx &= -\int_{-1}^1\s x_1\, \phi'\, dx_1\\ &= \int_{-1}^0 \phi'\, dx_1 - \int_0^1\phi'\, dx_1\\ &= -\phi(-1) + \phi(0) - \phi(1) + \phi(0)\\ &= 2\phi(0) \end{align*} So we are asked if there is any $g \in L^1_{\rm loc}(\Omega)$ such that, $$ \int_{-1}^1 g\phi\, dx = 2\phi(0), \quad \phi \in C^\infty_c(\Omega) $$ Suppose there were, choose $\phi_n \in C^\infty_c(\Omega)$ such that $0 \le \phi_n \le 1$, $\phi_n$ is supported in $[-\frac 1n, \frac 1n]$ and $\phi_n(0) = 1$. Now note that $g\phi_n \to 0$ almost everywhere, hence by dominated convergence, we have $$ 2 = 2\phi_n(0) = \int_{-1}^1 g\phi_n \, dx \to 0. $$ This contradiction shows that such a $g$ cannot exist.