Integrating unit impulse function Given that, 
$$ \delta(t) = \begin{cases} \infty & \text{if } t = 0 \\ 
0 & \text{if } t \ne 0\\ 
\end{cases}$$
How is it that, 
(A) 
$$
\int_{-\infty}^\infty \delta(t) dt = 1
$$
(B)
$$
\int_{-\infty}^\infty f(t) \delta(t) dt = f(0)
$$
considering $f$ continuos at $t=0$
Thanks in advance
 A: The "delta function" cannot actually be defined as a function. It can be interpreted either a distribution or as a measure. 
A: Can I assume you're a physicist and avoid the mathematical complexities a bit?
The integral finds the area under functions. $\delta(x)$ is a really skinny and really tall rectangle. In fact, it's width is $\epsilon$ and its height is $\omega$ so the area is given by $ \epsilon \cdot \omega$. The variable $\epsilon={1 \over {\omega}}$, so $ \epsilon \cdot \omega=1$. You'd just let $\omega \to \infty$ to get the integral of $\delta(x)$. Using this, I encourage you to figure out the answer to your other question.
More mathematical here. The delta 'function' is not a function in any typical sense. It's not continuous, differentiable, or integrable in the Riemann sense.
However, if you define it as a measure, you can look at it in a more rigorous way. A measure, is basically a way to assign mass, or weight, to subsets of the x axis. For instance, the way density can be integrated is a good example of a measure. There is some similarity with distributions as well.
Define the measure $\delta(dx)$ to be $1$ if $dx$ includes the value $0$ and $0$ otherwise. Using this definition, you can integrate with respect to the measure. Doing this, you get,
$$ \int_{-\infty}^{\infty} f(x) \ \delta(dx)=f(0)$$
Here's more information about the Dirac delta function, skip to the "As a Measure" section if you want.
A: One way to see this is by approximating the Dirac delta function $\delta(t)$ by a sequence of continuous functions. A convenient choice of approximating functions is the set of Gaussian kernels (i.e. normal distributions) with decreasing variance. 
Let,
\begin{align}
f_n(t) &= \frac{1}{\sigma_n \sqrt{2\pi}} e^{-\frac{t^2}{2\sigma_n^2}},
\end{align}
for positive integers $n$. We let $\sigma_n = \frac{1}{n}$, so that the variance approaches zero as $n$ grows arbitrarily large.
You can see that a the sequence $\{f_n\}$ converges pointwise to the Dirac delta function $\delta(t)$. There are some subtle points that I will not bring up here; but, if you plot this sequence, you will at least gain some intuition.
Since the sequence $\{f_n\}$ is a sequence of probability distributions, we have:
\begin{align}
\lim_{n \to \infty} \int_{-\infty}^{\infty}{f_n(t)dt} &= \lim_{n \to \infty} \int_{-\infty}^{\infty} {\frac{1}{\sigma_n \sqrt{2\pi}} e^{-\frac{t^2}{2\sigma_n^2}}} \\
&= \lim_{n \to \infty} 1 \\
&= 1.
\end{align}
Again, I have omitted some details here. To understand this in full mathematical rigor, you should take a course in measure theory.
A: All the other answers above are valid. Let me just add one point, which is often useful to remember in the world of distributions. The expression
$$
\int_{-\infty}^{\infty} f(x)\delta(x) dx
$$
should not be read as an integral. In fact, as you noticed yourself, there is no such function which is 0 everywhere except at a single point but still has nonzero integral. It just makes no sense. What we are actually trying to evaluate here is "the action of $\delta$ on a generic $\mathcal{C}^{\infty}_0$ function $f$". I am therefore thinking of $\delta$ as an object that I can apply to a function, to give me back a real number. In general, the 'action' of one such object $g$ is written in a more distinctive (and slightly less confusing) way as
$$
\langle g, f\rangle
$$
which is also called 'pairing'. These objects are called distributions. Slightly more formally, distributions are linear functions on $\mathcal{D}'(\mathbb{R}^n):=C^\infty_0(\mathbb{R}^n)$ (the set of continuous functions with compact support) that are continuous (with respect to the uniform norm on $C^\infty(\mathbb{R}^n)$), and the space of distributions is denoted with $\mathcal{D}'(\mathbb{R}^n)$. To make the pairing notation even less confusing (notice that, as I wrote it, it could be confused as an inner product), we can make the notation clearer (at the price of lightness) and write
$$
_{\mathcal{D}'(\mathbb{R}^n)}\langle g,f\rangle _{\mathcal{D}(\mathbb{R}^n)}
$$
to stress the fact that $f$ and $g$ are different objects and that this is not an inner product.
There are (I believe) two reasons why we sometimes still use the integral sign for distributions: first, it's lighter (since we're used to see it) and our eye can go through the steps faster without getting lost in notation; second, in some cases, such as $g\in L^2(\mathbb{R})$, the map that assign to each $f\in C^\infty_0(\mathbb{R})$ the real number
$$
\int_{-\infty}^{\infty} f(x)g(x)dx
$$
is well defined (because of Schwarz inequality). Therefore, to recall the analogy with integration (which is a particular case of 'pairing'), mathematicians often use the integral symbol, even if the pairing cannot be interpreted as an integral.
