Standard infinite-well formula: For an infinite square well the width $a$ determines the quantized energies through
\[ E_n = \frac{n^2\pi^2\hbar^2}{2m a^2}, \qquad n = 1, 2, 3, \dots \]
Identify the width: The box runs from $x = -2L$ to $x = +2L$, so its full width is
\[ a = 2L - (-2L) = 4L. \]
Confirm it is the ground state: The given wavefunction $\psi_0\cos\!\left(\frac{\pi x}{4L}\right)$ is symmetric and vanishes exactly at the walls, since at $x = \pm 2L$ the argument is $\pm\frac{\pi}{2}$ where the cosine is zero. It has no interior node, so it is the $n = 1$ level.
Plug in $n = 1$, $a = 4L$:
\[ E_1 = \frac{(1)^2\pi^2\hbar^2}{2m(4L)^2} = \frac{\pi^2\hbar^2}{2m\cdot 16L^2} = \frac{\pi^2\hbar^2}{32mL^2}. \]
Thus the ground-state energy is $\hbar^2\pi^2/(32mL^2)$.
\[ \boxed{E = \dfrac{\hbar^2\pi^2}{32mL^2}} \]