Khashishi said:
You can think of the integral as a functional, but it doesn't make sense to think of delta as a functional.
Dirac delta is indeed a linear functional. Specifically it is the linear functional such that ##f \mapsto f(0)##. Schwartz distributions are our most developed theory of generalized functions, and there all Schwartz distributions are linear functionals.
Now to OP.
If you want ##\delta^2 = \delta \cdot \delta## to exist as a Schwartz distribution as well, then it turns out that ##\delta^2 = c\delta## for some constant ##c##, but not for the reason you posted. The notation ##\delta^2## is reserved for the
product of Dirac with itself, not the composition of Dirac with itself. As to what ##c## is, there's a lot of disagreement. If the product defined is a "normal product" then ##c=0##. Some mathematicians have argued that non-zero c has physical meaning. Some argue ##c = \infty##. Others define it to be ##c = \delta(0)## and not define what that means (as long as it cancels in the end they are happy with it). So yeah a lot of disagreement.
That being said, if you aren't working with Schwartz distributions, such as working in
Colombeu algebra, then it is the operator ##f(x) \mapsto f(-x)^2## (technically the equivalence class of such operators), which in turn corresponds to the non-linear functional ##f \mapsto f(0)^2##
Edit: One last thing. There are people who write ##\delta^2## for ##\delta(x)\delta(y)##, i.e. the two dimensional Dirac delta. But then you wouldn't have ##\int \delta^2 = \infty## at the top of your post, so I'm ignoring that situation.