Is $E=0$ included in the energy spectrum of the free particle in 1d? In finding the eigenfunctions, $\psi_E$'s, of the free-particle Hamiltonian in 1d,
$$
H = -\frac{\hbar^2}{2m}\frac{d^2}{dx^2},
$$
with eigenvalues $E$'s, subject to the conditions that they are bounded, one finds that corresponding to each energy $E>0$, there are two orthonormal eigenfunctions given by $\psi_{E, +}(x)=A(E)e^{ik_Ex}$ and $\psi_{E, -}(x)=A(E)e^{-ik_Ex}$ where $k_E=\sqrt{2mE}/\hbar$ and $A(E)=(m/(8\pi^2\hbar^2E))^{1/4}$. These are easily seen to form an orthonormal set of functions (with equalities involving Dirac deltas).
However, we also have for $E=0$, a bounded eigenfunction $\psi_0(x) = C$ for some nonzero constant $C$. My concern is whether this should be included in the above set of orthonormal eigenfunctions.
On the one hand, $\psi_0$ satisfies
$$
\int_{-\infty}^\infty \psi_0(x)\psi_{E, \pm}(x)\; dx=0
$$
for all $E>0$. But it's not clear to me if the following condition,$^\dagger$
$$
\int_{-\infty}^\infty\psi_E(x)\psi_{E'}(x)\; dx\stackrel{?}{=}\delta(E-E')\quad\text{for all } E, E'\ge0,
$$
which is the requirement for the entire set (after adding $\psi_0$ to it) to be orthonormal, will be obeyed. If this holds true then it should be that
$$
|C|^2\int_{-\infty}^{\infty}dx = \delta(0)
$$
and I'm not at all sure if this holds.

$^\dagger$Here, by $\psi_E$ I mean any of $\psi_{E, \pm}$ if $E>0$, and $\psi_0$ if $E=0$.
 A: This question has an immediate answer - yes, because the spectrum of any operator is always closed.  This follows from the fact that the resolvent set $\rho_A$ of an operator $A$ is always open, and that the spectrum $\sigma_A=\mathbb C \setminus \rho_A$ by definition.
Note that the delta function can be expressed as
$$\delta(x) = \frac{1}{2\pi}\int_{-\infty}^\infty e^{ikx} dk$$
interpeted in the distributional sense.  Taking $x\rightarrow 0$, we find an expression like your last line (though of course, this is formally meaningless because distributions only make sense when they are integrated against suitable test functions, not evaluated at points).
A: There is a slight misunderstanding here, Look at the stationary state equation
$$\hat{H}|\Psi\rangle=E\Psi\rangle$$
or In position basis:
$$\left( \frac{\hat{p}^2}{2m}+V(\hat{x})\right)|\psi(x)\rangle=E|\psi\rangle$$
Note that it's eigenvalue equation for Hamiltonian and $E$ is eigen value. The eigen value depends on the Hamiltonian. You are not independent to choose it to be zero. Though You can ask what's the eigenstate corresponding to this equation.
Solving the eigen value problem for particle in box leads to
$$\psi_n(x)=\sqrt{\frac{2}{L}}\sin\left(\frac{n\pi x}{L}\right)$$
with $$E_n=\frac{n^2\pi^2\hbar^2}{2mL^2}$$
And as you can see that $E=0$ which corresponds to $n=0$ leads to $\psi_0(x)=0$ which is non-physical (says there is no particle in the box).

If the particle has zero energy, it will be at rest inside the well, and this violates Heisenberg’s uncertainty principle. By localizing or confining the particle to a limited region in space, it will acquire a finite momentum leading to a minimum kinetic energy. That is, the localization of the particle’s motion to $0 \leq x \leq a$ implies a position uncertainty of order $\Delta x \approx  a$ which, according to the
uncertainty principle, leads to a minimum momentum uncertainty $\Delta p \approx \hbar/a$ and this in turn leads to a minimum kinetic energy of order $\hbar^2/2ma2$. This is in qualitative agreement with the exact value $E_1$.
