You are starting from the incorrect point. The argument follows by linearity of the equation.
Suppose $\Psi_k(x,t)$ is solution of the time dependent
Schr$\ddot{\hbox{o}}$dinger equation:
$$
i\hbar \frac{\partial }{\partial t}\Psi_k(x,t)=-\frac{\hbar^2}{2m}\frac{\partial^2\Psi_k(x,t)}{\partial x^2}+U(x)\Psi_k(x,t)\, .
$$
Then:
$$
\Phi(x,t)=a_1\Psi_1(x,t)+a_2\Psi_2(x,t)
$$
is also a solution since
$$
i\hbar \frac{\partial }{\partial t}\Phi(x,t)
=a_1\left(i\hbar \frac{\partial }{\partial t}\Psi_1(x,t)\right)+a_2
\left(i\hbar \frac{\partial }{\partial t}\Psi_2(x,t)\right)
$$
and
\begin{align}
-\frac{\hbar^2}{2m}\frac{\partial^2\Phi(x,t)}{\partial x^2}+U(x)\Phi(x,t)
&=a_1\left(-\frac{\hbar^2}{2m}\frac{\partial^2\Psi_1(x,t)}{\partial x^2}+U(x)\Psi_1(x,t)\right)\\
&\quad + a_2\left(-\frac{\hbar^2}{2m}\frac{\partial^2\Psi_2(x,t)}{\partial x^2}+U(x)\Psi_2(x,t)\right)\, .
\end{align}
These follow simply from the known rule valid for any two differentiable functions $f$ and $g$: $\partial (f+g)/\partial t=\partial f/\partial t+\partial g/\partial t$, and similarly for the partials w/r to $x$.
Combining these last two equations you get an identity for any $a_1$ and $a_2$ since each $\Psi_k(x,t)$ is independently a solution. Of course this simply extends to an arbitrary number of terms in the linear combination.
Note the eigenvalue of the time-independent part never enters in this argument. The final step is to observe that separation of variables in the time-dependent equation yields $\Psi_k(x,t)=e^{-iE_k t}\psi_k(x)$ with $\psi_k(x)$ an eigenfunction of the time-independent equation, but again, this does not enter in the argument.
Edit: note this is in contradistinction with the time-independent equation. When
$$
-\frac{\hbar^2}{2m}\frac{d^2\psi_k(x)}{dx^2}+U(x)\psi_k(x)=E_k\psi_k(x)
$$
the the right hand side is must a multiple of the original function. With this observation, note then
that a linear combination
$$
\psi(x)=a_1\psi_1(x)+a_2\psi_2(x)
$$
will in general NOT be a solution of the time-independent equation because
\begin{align}
\left(-\frac{\hbar^2}{2m}\frac{d^2}{dx^2}+U(x)\right)\psi(x)
&=a_1\left(-\frac{\hbar^2}{2m}\frac{d^2}{dx^2}+U(x)\right)\psi_1(x)\\
&\qquad+a_2\left(-\frac{\hbar^2}{2m}\frac{d^2}{dx^2}+U(x)\right)\psi_2(x)
\\
&=a_1E_1\psi_1(x)+a_2E_2\psi_2(x)\\
&=E_1(a_1\psi_1(x)+a_2\psi_2(x))+(E_2-E_1)a_2\psi_2(x)\\
&=E_1\psi(x)+(E_2-E_1)a_2\psi_2(x)
\end{align}
will NOT be a multiple of $\psi(x)$ unless $E_1=E_2$.
Best Answer
So by "general solution" you mean something like $$ \psi_{general} = \sum_{n = 1}^\infty c_n \left[\sqrt{\frac{2}{a}}\sin\left(\frac{n\pi x}{a}\right)\right],\ \ c_n \in \mathbb{C}, $$ right? (I'm supposing that the infinite square well's walls are at $0$ and $a$, and I'm writing $c_j$ for arbitrary complex numbers. Also, note that I've pulled a constant factor $\sqrt{2/a}$ out of the constants and put it into brackets---you'll see the reason for that in a bit.)
The thing is, this expression $\psi_{general}$ doesn't have any physical meaning as is. You also have to pick values for the $c_n$ before you can think of it as a particular state. For example you could write $$ \psi = \sum_{n = 1}^\infty c_n\left[\sqrt{\frac{2}{a}}\sin\left(\frac{n\pi x}{a}\right)\right],\\ c_n = 1/\sqrt{100},\ \ n \le 100, \text{$n$ odd}\\ c_n = 0, \ \ n \le 100, \text{$n$ even}\\ c_n = 0, \ \ n \ge 100 $$ or just $$ \psi = \frac{1}{\sqrt{100}}\sum_{n = 1}^{50} \left[\sqrt{\frac{2}{a}}\sin\left(\frac{(2n - 1 )\pi x}{a}\right)\right]. $$
Vladimir Kalitviansky is exactly right that this sort of state is a "superposition" of a whole bunch of other states. What that means, though, is pretty deep. The idea is that when you're in a superposition of many states, you have a certain probability to end up in any of them. If I measure the energy of a particle in state $\psi$, the wavefunction will collapse into a randomly selected one of the states $$ \psi_n = \sqrt{\frac{2}{a}}\sin\left(\frac{n\pi x}{a}\right) $$ (I think these are the separable solutions to which you refer) and you'll measure an energy $E_n = \frac{n^2\pi^2\hbar^2}{2ma^2}$; the probability that the state will end up in any particular state $n$ is $|c_n|^2$, or in this case $1/100$. So: you start out in $\psi$, I measure your energy to be $E_n$, and you end up in a state $\psi_n$.
It's important to understand that which state you end up in is totally random. There is absolutely no way to tell beforehand what state it'll be, and therefore what energy will be measured---no hidden variables that determine what the state will turn out, and no correlations with other variables. Sure, you know that some states (those with the largest $c_n$ associated) will be more likely than others, but that's it. This is the principle behind many hardware random number generators.
You're presumably wondering about those functions $\psi_n$. I haven't told you why the state will collapse into those particular functions. What's so special about the $\psi_n$ as opposed to some other function---say, $\arccos(\sinh(\exp(x)))$? Also, I just pulled the numbers $E_n$ out of nowhere, which is distinctly unsporting.
What's going on is that these functions are eigenfunctions of the Hamiltonian with eigenvalue $\frac{n^2\pi^2\hbar^2}{2m}$. The vocabulary about eigen-stuff is just putting names to some facts I you've already realized: namely, that when I apply the Hamiltonian $$ H = -\frac{\hbar^2}{2m} \frac{d^2}{dx} $$ to one of the states $\psi_n$, I get back $\psi_n$ (the eigenfunction) multiplied by a constant $E_n$ (the eigenvalue)---that is to say, $$ -\frac{\hbar^2}{2m} \frac{d^2}{dx} \psi_n = \frac{n^2\pi^2\hbar^2}{2ma^2}\sqrt{\frac{2}{a}} \sin\left(\frac{n\pi x}{a}\right) = E_n \psi_n, $$ which is just the (time-independent) Schrodinger equation. So, t'm in ao rephrase my summary: you start out in a superposition of states, I measure your energy, and you end up in some eigenfunction of the Hamiltonian.
This is one (well, two) of the general axioms of quantum mechanics: if the eigenfunctions of the Hamiltonian are $\psi_n$ (these don't have to be the $\psi_n$ I wrote down above, if the Hamiltonian is not the square-well Hamiltonian) and I measure the energy of a particle in a state $\psi$, then the particle will end up in a state $\psi_n$ with probability $$ P(n) = \left|\int_{-\infty}^\infty \psi_n^* \psi\ dx\right|^2 = |c_n|^2 $$ (where $^*$ denotes complex conjugation---that always causes me some confusion, since mathematicians use the symbol differently). That last step (where I bring in the $c_n$s) is not totally obvious. It follows from the fact that the $\psi_n$ are orthonormal---that is, $\int_{-\infty}^\infty \psi_j^*\psi_k\ dx = 1$ if $j = k$, and $0$ if $j \ne k$. You'll want to work out for yourself exactly how that works. First, notice that the $\psi_{general}$ can be written nicely in terms of the $\psi_n$; then, plug that $\psi_{general}$ into the above expression for $P(n)$; finally, prove that the particular $\psi_n$ I wrote for the square-well case are orthonormal using a trig identity (that's why I put the constant out front of them).
This imposes the very important constraint that $$ \sum |c_n|^2 = \sum P(n)= 1. $$ The particle has to end up in at least one of the states, so the sum of the probabilities can't be less than $1$, and it would be total nonsense for the total probability to be greater than $1$, so $1$ it is. This is called "normalization", as in "the state is normalized".
As another fun exercise, explore the state I gave you as a specific example. Plot it ($x$ in units of $a$), change that 100 to a bunch of different numbers $N$ (you'll have to change the value of the $c_j$ so that the state is normalized), and plot again. You should see that the state is more or less localized around $x = a/2$. What is the width of the state, and how does that width (call it $\Delta x$) change with N? Given that the momentum of an eigenstate $\psi_n$ is $p_n = \sqrt{2mE} = n\pi\hbar /a$, how does this relate to Heisenberg's uncertainty principle?
I should note that I've skipped a whole bunch of details, and not just in that exercise at the end. If any of them are bothering you, ask! Hope this helps.