Dirac Delta Function - different definitions

Some define the Dirac Delta Function as:

$$\int_{-\infty}^{\infty}\delta(x)f(x)\ dx=f(0)$$

For every continuous function $$f$$. In some books, I've noticed a different definition of $$\delta(x)$$ as an operation that satisfies the following two conditions:

$$\int_{-\infty}^{\infty}\delta(x)\ dx=1\quad\text{and}\quad\forall x\neq0:\delta(x)=0$$

Are the two definitions the same?

First of all, $$\delta$$ is not a function ! There are no function s.t. $$\int_{\mathbb R}\delta (x)=1\quad \text{and}\quad \forall x\neq 0, \delta (x)=0.$$
The second definition is rather not correct strictly speaking, but should be understood as $$\int_{\mathbb R}\delta (x)\,\mathrm d x=1\quad \text{and}\quad \int_A \delta (x)\,\mathrm d x=\begin{cases}1&0\in A\\ 0&\text{otherwise}\end{cases}.$$
• You can see $$\int_A\delta (x)\,\mathrm d x:=\int_{\mathbb R}\delta (x)\boldsymbol 1_A(x)\,\mathrm d x.$$ Then use the standard approximation theorem to prove that $$\int_{\mathbb R}f(x)\delta (x)dx=f(0).$$ Notice that the writing $\delta (x)dx$ is a bit confusing, and should rather be written either $\mathrm d \delta (x)$ or even better $\delta (\mathrm d x).$. And thus $(\mathbb R,\mathcal M,\delta )$ can be seen as a measure space. And all theorem you know as DCT, MCT, Fatou , approximations by simple function... works.