Formally derive $\displaystyle\int_{x=-\infty}^{x=\infty} f(x) \delta(x) \, \mathrm{d}x = f(0)$ I have been searching for a derivation of the defining property for the Dirac-delta function: $\displaystyle\int_{x=-\infty}^{x=\infty} f(x) \delta(x) \, \mathrm{d}x = f(0)$ and found this derivation on the first 2 pages: 
Defining the Heaviside (step) function $H(x)$ as
$$H(x) = \begin{cases} 0 & \text{for } x \lt 0 \\1& \text{for } x \gt 0 \end{cases} $$ The derivative of the Heaviside function is zero for $x \ne 0$ and undefined for $x=0$ so the $\delta$ function can represent the derivative of the Heaviside function
$$\delta(x) = \begin{cases} 0 & \text{for } x \ne 0 \\\infty& \text{for } x = 0 \end{cases} $$ and $$\int_{x=-\infty}^{x=\infty} \delta(x) \, \mathrm{d}x=1$$ 
Let $f(x)$ be any continuous function that vanishes at $x=\pm\infty$ and integrating by parts
\begin{align}
& \int_{x=-\infty}^{x=\infty} f(x)\delta(x) \, \mathrm{d}x = \color{green}{\left.\vphantom{\frac 1 1} f(x)H(x) \right|_{x=-\infty}^{x=\infty}} -
\int_{\color{red}{x=-\infty}}^{x=\infty} f^\prime(x)H(x) \, \mathrm{d}x \\[10pt]
= {} &0-\int_{\color{red}{x=0}}^{x=\infty} f^\prime(x)H(x) \, \mathrm{d}x= \left.\vphantom{\frac 1 1}-f(x) \right|_{x=0}^{x=\infty}=f(0)
\end{align}
Could someone please explain how the limits marked $\color{red}{\mathrm{red}}$ were changed?
Thank you.
(and yes I know from last time, it's an abuse of notation placing the Dirac measure/distribution inside an integral) 

The way the limits in red were changed is simply that the piecewise definition of $H$, stated earlier in the question, says that $H(x)=0$ when $x<0$.  Thus
$$
\int_{-\infty}^0 (\text{anything}\times H(x))\, dx = 0.
$$
The idea that $\delta(0)=\infty$ should not be taken too literally.  Notice that
$$
\int_{-\infty}^\infty 3.4\delta(x) f(x)\,dx = 3.4f(0),
$$
so one would then say that this "infinity" is $3.4$ times as big as the earlier "infinity".  But no attempt is made to give such concepts any precise definition.  If one wants to show that $H'(x)=\delta(x)$, one can observe that $H$ has a vertical jump at $0$ and therefore say there is an infinite slope, but again no attempt is made to make that precise.  Rather, one precisely defines $H'$ by integrating by parts, as you did.
