When spectrum of eigenvalues of Schrodinger equation is continuous or discrete? There is a point which I do not understand about the Schrödinger equation. I will try to explain the issue.
Consider the Schrödinger equation:
$\hat H =  \frac{ \hat p^2}{2m} + U(\hat x)$
and we are interested in stationary states: $\hat H \psi = E\psi$.
Consider firstly a localized potential that falls off rapidly at infinity ($U(x \to \pm \infty)\to 0$). Then, in the Schrodinger equation, we can drop potential term, and finally solve eqn:
$-\frac{\hbar ^2}{2m}\psi''(x) = E\psi(x)$
and we get solutions:
$
E > 0:  
\psi(x)=Ae^{ikx}+Be^{-ikx}
$
and another:
$
E<0:
\psi(x)=Ce^{\kappa x}+De^{-\kappa x}
$
And I have in lecture:

"The first case $E > 0$ corresponds to continues spectrum, and second case - to discrete spectrum. Further more when $x \to \infty$ constant $C$  must go to zero, and when  $x \to - \infty$ constant $D$ must go to zero. Last two conditions satisfied only in case of discrete set of energies, which give us spectrum of bounded states".

I have many questions about that.
If we take $E >0$, ok. But, why we decide in second case $E < 0 $  there will be discrete set of energies? If I look on wavefunction I can take any energy and put inside and nothing will happen with wavefunction.
Another point is:

"Furthermore when $x \to \infty$ constant $C$ must go to zero, and when  $x \to - \infty$ constant $D$ go to zero", but in this case $C$ and $D$ will be zero, and in case of $E < 0$ wavefuntion will be zero. But how they conclude from that point that there will be discrete set of energies?

And final question is that, how bounded state and state of discrete spectrum are related. Everywhere it is written as postulate: we have bounded state thus this states are discretized. But why? no one explains.
Hopefully someone could help me with understanding this fact.
 A: Quantization appears as a result of bounding the motion, i.e. quantization appears as a result of enforcing $\vert\psi(x)\vert^2\to 0$ as $x\to\infty$.
Broadly speaking, it is not possible to satisfy this condition in general unless the energies take on very specific and discrete values.
This point is made very clearly in

Mott, Sir Nevill. "On teaching quantum phenomena." Contemporary Physics 5, no. 6 (1964): 401-418.

Usually, the discrete nature of the spectrum comes out of solving the Schrödinger equation and imposing the condition at infinity, as done in the harmonic oscillator or the hydrogen atom.  There are also methods (like WKB) to show that bound states exists, but they produce upper bounds on the energies so are not actually proofs of quantization.
The conditions $E\le 0$ or $E\ge 0$ must be handled with some care as they depend on where the $0$ of energy is defined.  In problems where $V\to 0$ at infinity, it is convenient to have $E<0$ for bound states, and thus quantized states, but of course it doesn't make sense to have $E<0$ in the case of a harmonic potential since $V \to \infty$ as $x\to \infty$ (for instance), yet the energies are still quantized.
If the wavefunction cannot be made to satisfy $\vert\psi(x)\vert^2\to 0$ as $x\to\infty$, the resulting energies will not be constrained and the spectrum will be continuous rather than discrete.  Examples include plane waves and Krönig-Penney-type solutions (basically plane waves in solids), as well as scattering states.
A: You have a mathematical problem: to find a function $\psi(x)$ satisfying a differential equation (Schroedinger equation). But you know that equation alone is not enough. You also have to impose some additional conditions that the solution must satisfy, $n$ in total, where $n$ is the order of your differential equation (for Schroedinger $n=2$).
The most standard conditions one are the so-called initial conditions, i.e. when you require from the beginning the values for the function (and $n-1$ of its derivatives) at some point. The existence and uniqueness theorem guarantees you that a (ordinary) differential equation will always have a unique solutions with these initial conditions, no matter what the parameters of your ODE are.
This is the case when $E>0$. Here your $\psi$ is finite no matter how far you are from the origin, hence all you do is to require that e.g. $\psi(x=0)=1$ and, say, $\psi'(x=0)=0$. Then you always have a solution, for all parameter values, including energy $E$, hence continuous spectrum.
When $E<0$, Schroedinger equation implies that wave function is either exponentially growing or decaying as $|x|\rightarrow \infty$, for a localized potential $U(x)$. Your wave-function obviously should not explode at infinity (you can't normalize it in this case, even the Dirac way), therefore it must be decaying to zero at $x=\pm \infty$. Therefore what you have here is a different problem. Instead of initial conditions at the origin, you only know that $\psi(\infty) = \psi(-\infty)=0$. This is called a boundary value problem and generally speaking it does not have any solutions, save for special values of the ODE parameters. Energy $E$ is one such parameter, and indeed for some values of $E$ you do get nontrivial solutions such that $\psi(\pm \infty)=0$.
To summarize, you always get continuous spectrum when wavefunctions are unbounded ($E>0$ in your case), because mathematically it is a ODE with initial values. Conversely, for bound wavefunctions ($\psi(\pm \infty)=0$) the spectrum is always discreet (sometimes you don't have any bound solutions), because now it is a boundary value problem.
P.S. Historically this idea that boundary value problems have a discreet set of solutions is said to have inspired Schroedinger to try to formulate QM in terms of differential equations.
