Is it possible to have a distribution $u\in \mathcal{D}'(\mathbb{R})$ such that the restriction of $u$ to $(0,\infty)$ is $\frac{1}{x}$ and the restriction of $u$ to $(-\infty,0)$ is $0$?
It seems to me that the answer should be 'no', but I couldn't figure how to prove it.
It is possible: define $u\in\mathcal D'(\mathbb R)$ by $u(\phi)=\int_0^\infty \frac 1 x (\phi(x)-\phi(0)e^{-x}) dx$.
Note that for any test function $\phi$, the function $x\mapsto \phi(x)-\phi(0)e^{-x}$ is smooth and sends zero to zero (and has compact support), which implies that $(\phi(x)-\phi(0)e^{-x})/x$ can be integrated on $(0,\infty)$. (Thanks Julián Aguirre for pointing out the problem with just integrating $\phi(x)/x$.)
$u$ is clearly linear. To show that $u$ is a distribution, consider a sequence $\phi_n\to 0$ in $\mathcal D(\mathbb R)$. The support of the functions $\phi_n$ is contained in some interval $[-K,K]$ (and we can assume $K\geq 1$). By integration by parts we have $$u(\phi_n)=\lim_{\epsilon\to 0^+}\int_\epsilon^K \frac 1 x (\phi_n(x)-\phi_n(0)e^{-x}) dx =-\lim_{\epsilon\to 0^+}\int_\epsilon^K \log(x) (\phi_n'(x)+\phi_n(0)e^{-x}) dx$$
Note $\int_0^K|\log x|dx\leq K\log K+1$. Thus $$|u(\phi_n)|\leq (K\log K+1) \max_{0\leq x\leq K}(|\phi_n'(x)|+|\phi_n(0)|)\to 0$$