I am reading Alexander Altland and Jan von Delft's Mathematics for Physicists. They introduce the delta function as follows. $\delta_{y}(x)$ is the function such that for all continuous functions $f:\mathbb{R}\rightarrow\mathbb{R}$ $$\int_{\mathbb{R}}\delta_{y}(x)f(x)\,dx=f(y)$$Any constant function $f(x)=c$ immediately gives me $$\int_{\mathbb{R}}\delta_{y}(x)\,dx=1$$ The authors then claim that the delta function vanishes everywhere except at $x=y$, otherwise we can choose an $f$ to give us a contradiction. Quote:
If $\delta_{y}(x)$ were non-vanishing for $x\neq{}y$, it would be possible to devise functions $f(x)$ such that the integral $\int_{\mathbb{R}}\delta_{y}(x)f(x)\,dx$ yields a value different from $f(y)$. Think about this point. (272)
Assume that $x_{0}\neq{}y$ and $\delta_{y}(x_{0})\neq{}0$. How would I define $f$ to get the promised contradiction?