Multiple solutions for a particle in an infinite potential well I am starting to learn about quantum mechanics and was wondering about the solutions to a question about a particle in an infinite potential well of length $L$. 
The solutions are:
$$\psi_n(x) = \sqrt{\frac{2}{L}}\sin\left(\frac{\pi n x}{L} \right)$$
And I was wondering what is the meaning of $n$. Isn't there supposed to be only one wave function? In that case, $\Psi = \sum_{n=1} ^\infty a_n \psi_n$, but what are the $a_n$? Or maybe it is probabilistic, and we don't know which $\psi_n$ the particle is currently in?
 A: The solutions $\psi_n(x)$ to the time-independent Schrodinger equation are basis solutions which can be combined to obtain perfectly general solutions:
$$
\psi(x)=\sum_n a_n\psi_n(x) \tag{1}
$$
In $\psi_n(x)$, the integer $n$ simply labels the different solutions, which have different energies given by
$$
E_n=\frac{n^2\hbar^2\pi^2}{2mL^2}\, .
$$
Of course, a function like $\psi(x)$
is not in general a solution of the time-independent Schrodinger equation; nevertheless, it is a perfectly valid wavefunction if it satisfies the boundary conditions of the problem (and, in your case, is normalizable).
For example, the function 
$$
\psi(x)=\sqrt{\frac{30}{L^5}}x(x-L)
$$
satisfies the boundary condition of the infinite well and is thus a legitimate wavefunction: it is not a solution to the time-independent Schrodinger equation
$$
-\frac{\hbar^2}{2m}\frac{d^2}{dx^2}\psi(x)\ne E\psi(x)
$$
for any $E$ but $\psi(x)$ can be expanded as
$$
\sqrt{\frac{30}{L^5}}x(x-L)=\sum_m a_m \sqrt{\frac{2}{L}}\sin
\left(\frac{m\pi x}{L}\right)\, .
$$
If the time-dependent solutions are $\Psi_n(x,t)=e^{iE_nt/\hbar}\psi_n(x)$, then the combination
$$
\Psi(x,t)=\sum_n a_n e^{-iE_nt/\hbar}\psi_n(x)
$$
is solution to the time-dependent Schrodinger equation
$$
i \hbar \frac{\partial }{\partial t}\Psi(x,t)=H\Psi(x,t) \tag{2}
$$
provided $H\Psi_n(x,t)=E_n\Psi_n(x,t)$.  Inserting $t=0$ in Eq.(2) yields Eq.(1), i.e. the function $\psi(x)$ defined by the superposition is the solution $\Psi(x,t)$ evaluated at some specified time.
This is not an uncommon situation: for instance, a pulse is linear combination of plane waves
$$
\phi(x,t)=\int dk c(k)e^{i(kx-\omega t)} \tag{3}
$$
where the function $c(k)$ determines the shape of the pulse, and the heat equation is solved by summing Fourier components.
The $a_n$'s are thus a discrete version of the $c(k)$'s defining the shape of the pulse of Eq.(3).  Like $c(k)$, $a_n$ can be real or complex.  The $c(k)$'s can be obtained by Fourier analysis, and the $a_n$ likewise can be recovered using the orthogonality property of the solutions $\psi_n(x)$:
$$
a_n=\int dx\, \psi(x)\psi^*_n(x)\, .
$$
The real number $\vert a_m\vert^2$ is the probability of obtaining the energy $E_m$ when the system is described by $\Psi(x,t)$.  
A: Each of the $\psi_n$ represent eigenfunctions of the Hamiltonian of your system. 
This is, each one of them is a possible state of the system with well-defined energy, given by its eigenvalue $E_n=\frac{(n\hbar\pi)^2}{2mL^2}$
Since Schrödinger's equation is linear, any linear combination of the $\psi_n$ is also a possible state of your system, albeit it would have no well-defined energy (you'd get different results when measuring energy on that kind of systems, with the energy of the eigenstates with bigger coeficients being more porbable).
However, these are possible states, it doesn't mean that your system will be in all of the eigenfuntions and their linear combinations, but that for your system to be in a particular state $\phi$, it must be a linear combination of the eigenvalues $\psi_n$. 
The infinite sum you write is the most general expression for a "linear" (it isn't linear because the sum is infinite, but it fortunately works as if it was) combination of the eigenstates, with $a_n$ being the linear coefficient of $\psi_n$. Because of the above, all allowed states can be written in this form.
