A distribution is not a function, it is a functional acting on (a suitable space of) functions.
In particular, let's consider the functions of rapid decrease $\mathscr{S}(\mathbb{R}^d)$. Its topological dual, $\mathscr{S}'(\mathbb{R}^d)$, is the space of continuous linear functionals of $\mathscr{S}$, and it is called the space of tempered distributions.
How does a distribution work? It is a map that associates to each $f\in\mathscr{S}$, a complex number. Its action is usually denoted by $(\phi,\cdot)$, where $\phi\in\mathscr{S}'$. The Dirac delta distribution $\delta\in\mathscr{S}'$, is the distribution defined by:
$$(\delta,f)=f(0) \quad, \quad f\in\mathscr{S}(\mathbb{R}^d)\; .$$
Now the rapid decrease functions are dense in the tempered distributions, in a suitable topology (the $\sigma(\mathscr{S}',\mathscr{S})$ one). And there is a natural identification of $f\in\mathscr{S}$ with the corresponding element $\tilde{f}\in\mathscr{S}'$: $\tilde{f}$ is the distribution whose action is defined by
$$(\tilde{f},g)=\int_{\mathbb{R}^d}f(x)g(x)dx\quad ,\quad g\in\mathscr{S}(\mathbb{R}^d)\; .$$
So if the $\delta$ distribution was a real function $\delta(x)$ (but it is not!), we could write
$$(\delta,f)=\int_{\mathbb{R}^d}\delta(x)f(x)dx=f(0)\; .$$
This is what it is usually done by physicists, but it is an abuse of notation. Another abuse of notation, is to write $\int_{\mathbb{R}^d}\delta(x)dx=1$. In principle, it is not possible to define the integral of a distribution. However this abuse of notation may be justified as follows:
- It is possible to approximate the delta distribution by rapid decrease functions, since $\mathscr{S}$ is dense in $\mathscr{S}'$. Indeed, given an integrable function $\eta$, such that $\int\eta(x)dx=1$, then
$$\delta_h(x)=\frac{1}{h^d}\eta\bigl(\tfrac{x}{h}\bigr)$$
is an approximation of $\delta$, in the sense that
$$\lim_{h\to 0}\int_{\mathbb{R}^d}\delta_h(x)f(x)dx=f(0)\quad ,\quad f\in\mathscr{S}(\mathbb{R}^d)\; .$$
Since, in addition,
$$\int_{\mathbb{R}^d}\delta_h(x)dx=1$$
uniformly in $h$, it is tempting to conclude that $\int_{\mathbb{R}^d}\delta(x)dx=1$ (but it is not true, since- very roughly speaking -you are not allowed to take the limit inside the integral).
The above type of approximations $\delta_h$, also suggest the "pictorial" representation of $\delta$ as a function (but it is not!) that is zero everywhere, and infinity in zero. However, this is just a pictorial representation (that may be useful, but is not rigorous); so it cannot be used to argue pro or against the notation $\int_{\mathbb{R}^d}\delta(x)f(x)dx$ (that again is just an abusive notation, and not a rigorously defined integral).