$\delta(0)=\int_{-\infty}^\infty |x_1(x)|^2dx$? In non-relativistic quantum mechanics: 
By definition $$\langle x_1|x_1\rangle=\int_{-\infty}^\infty |x_1(x)|^2dx.$$
On the other hand,
$$\langle x_1|x_2\rangle=\delta(x_2-x_1).$$ 
Where $x_1$ and $x_2$ are positions and $\delta$ is Dirac delta function.  
Take $x_1=x_2$, $$\langle x_1|x_1\rangle=\delta(0)=\int_{-\infty}^\infty |x_1(x)|^2dx~ ?!$$
Could you please correct my false understanding? 
 A: It's a general phenomenon that if an eigenstate corresponds to a discrete eigenvalue (like the bound eigenstates of the hydrogen atom or harmonic potential hamiltonians), the state is normalizable, and if it corresponds to a continuous eigenvalue, the state is not normalizable. By "continuous eigenvalue" I mean an eigenvalue that belongs to a continuous part of the spectrum. The position operator $\hat{x}$ has a continuous spectrum, so, it's not really a problem that asking for the norm of $|x\rangle$ doesn't make sense, because we shouldn't expect that state to have a well-defined norm in the first place. 
Things look weird in your example because of the delta function, but the weirdness occurs elsewhere too. For example, consider the momentum operator $\hat{p}$. An eigenvector of $\hat{p}$ with eigenvalue $p$ is: 
$$\psi_p(x)=e^{i  p x}$$
The integral of the norm of this over all of space clearly diverges. This is exactly the same issue as the "$\delta(0)$" problem. So one has to choose its normalization by another condition. Usually this is done via the identity $\int_{-\infty}^\infty e^{ikx}dk=2\pi\delta(x)$, which can be made rigorous other ways. Then we usually define 
$$\langle x|p\rangle=\psi_p(x)=\frac{1}{\sqrt{2\pi}}e^{-i  p x}$$
as the correct normalization, because then
\begin{align*}
\langle p | p'\rangle&=\int \langle p | x \rangle\langle x | p'\rangle dx \\
&=\int \frac{1}{\sqrt{2\pi}}e^{-ip x}\frac{1}{\sqrt{2\pi}}e^{ip' x}dx \\
&=\int \frac{1}{2\pi}e^{ix(p'-p)}dx \\
&=\delta(p'-p)
\end{align*}
This definitely is a distinct normalization condition from $\langle p | p\rangle=1$! Other normalizations are useful for other contexts. If I recall correctly, the "probability 1 for 1 unit cube" normalization (corresponding to the first case with no pi's in it) is more useful when calculating scattering cross sections. 
This is generally all possible to make rigorous, but you don't get that much out of it. For the spectrum of the $\hat{x}$ operator, these eigenstates are not technically in the Hilbert space. To make the second set of equations rigorous, you generally act on a test function (so instead of worrying about whether $\int_{-\infty}^\infty e^{ikx}dk=2\pi\delta(x)$, you worry about whether $\int_{-\infty}^\infty\int_{-\infty}^\infty e^{ikx} f(x)dkdx=2\pi f(0)$, for various restrictions on the function $f$ and various limits of the integral. It's useful paying some attention to these technicalities, but you generally don't get much physics out of it.
A: Assuming everything we're doing is well defined (which is not really true, but last time I checked this wasn't math.stackexchange), we have the following:
$$\begin{align}
\langle x_1 | x_1 \rangle &= \int \mathrm{dx}\ |x_1(x)|^2 \\
&= \int \mathrm{dx}\ \delta(x-x_1)^2 \\
&= \int \mathrm{dx}\ \delta(x-x_1)\delta(x-x_1) \\
&= \delta(x_1 - x_1) \\
&= \delta(0)
\end{align}
$$
so everything works out. The crucial step is the fourth equality, where I've used $\int \mathrm{d}x\ \delta(x-x_1) f(x) = f(x_1)$ with $f(x) = \delta(x-x_1)$.
