In a discrete $n$ dimensional vector space the Kronecker delta $\delta_{ij}$ is basically the $n \times n$ identity matrix. When generalizing from a discrete $n$ dimensional vector space to an infinite dimensional space of functions $f$ it seems natural to assume that the generalization of the Kronecker delta should be an identity operator $$ \operatorname{I} f = f $$ However it is said that the continuous generalization of the Kronecker delta is the Dirac delta function $$ \int_{-\infty}^\infty \delta(x - y) f(x)\, dx = f(y) $$ Why is that the case? What is "wrong" with the simple identity operator?
UPDATE: What I mean with "simple" identity operator is: Why is the identity operator not simply the scalar number "1", but the delta function instead?
UPDATE2: To make it more clear: Why is the continuous generalization of the Kronecker delta $$ \int_{-\infty}^\infty \delta(x - y) f(x)\, dx = f(y) $$ and not $$ 1 \cdot f(x) = f(x) $$ ?