Consider the differential equation:
$y'' = \lambda y$
with the boundary conditions $y(0) = y(2\pi) = 0$.
This equation has eigenfunctions $\mu_n(x) = \sin(\frac{nx}{2})$ with the corresponding eigenvalues $\lambda_n = -\frac{n^2}{4}$ for $n > 0$
Am I right, that certain functions f(x) satisfying the same boundary conditions as above can be represented as an infinite series $f(x) = \sum_1^\infty c_n \mu_n(x)$ with coefficients $c_n = \frac{\langle f,\mu_n \rangle}{\langle \mu_n, \mu_n \rangle}$? What conditions those certain functions need to satisfy?
Can the previous claim be generalised for any set of eigenfunctions of some differential equation? I.E. suppose $Ly = \lambda y$ is a differential equation ($L$ being the 2nd order differential operator) with boundary conditions $y(a) = y(b) = c$ . What functions can be represented as a weighted sum of the eigensolutions?
Your question situates within the realm of Sturm-Liouville theory and my subsequent answer applies to all differential operators (with associated eigenfunctions) that belong to this realm. You asked which continuous functions can be expanded in a series of eigenfunctions? The most natural answer turns out to be "functions that are square-integrable on the interval $(0,2\pi)$". Also non-continuous, square-integrable functions $f$ can be expanded in this way (under the proviso that $f$ is allowed to differ from its series-expansion $\sum_{1}^{\infty} \frac{\langle \mu_n,f\rangle}{\langle \mu_n,\mu_n\rangle} \mu_n(x)$ on a subset of $(0,2\pi)$ of measure zero)