I'm having a hard proving an identity which includes the Dirac delta function and the Heaviside function. I want to show that for $m\in\mathbb{R},k\in\mathbb{R}^4$ and $\omega_{\bf k} \equiv \sqrt{{\bf k}^2+m^2}$ and $k^2= \eta_{\mu\nu}k^\mu k^\nu$ we have $$\delta\left(k^{2}-m^{2}\right)=\frac{1}{2 \omega_{\mathbf{k}}}\left[\theta\left(k_{0}\right) \delta\left(k_{0}-\omega_{\mathbf{k}}\right)+\theta\left(-k_{0}\right) \delta\left(k_{0}+\omega_{\mathbf{k}}\right)\right],$$ where $\eta_{\mu\nu}$ is the Minkowski metric with signature $(+,-,-,-)$.
My attempt here was to use the fact that we have $$\delta(g(x))=\sum_i \frac{\delta(x-x_i)}{|g'(x_i)|},$$ where the $x_i$ are the roots of $g$. By setting $g(k_0)=k^2-m^2= k_0^2-\omega_{\bf k}^2$ we find $g'(k_0)=2k_0$ and the roots $\pm\omega_{\bf k}$. Inserting this into the identity for the delta function leads to $$\delta(k^2-m^2)=\frac{1}{2|\omega_k|}(\delta(k_0-\omega_{\bf k}) + \delta(k_0+\omega_{\bf k})),$$ which comes close to what I want to prove but is not quite there yet since the Heaviside function is still missing. The problem is now that I don't see how you can get it in there...
Can somebody maybe help me in that last step?