How is it possible to have Fermi energy in the middle of bandgap for semiconductors? Actually, I'm still a beginner for Fermi energy and its related band theory. Typically in an intrinsic semiconductor the Fermi energy or the highest occupied energy level of electrons at $0\, \mathrm K$ is placed at the middle of the band gap. How is this possible if the band gap doesn't hold any allowed energy state?
 A: The fact that the Fermi energy is in between two energy levels is actually general property of systems with discrete energy levels. The point is that the Fermi energy is not defined as the highest occupied energy level at zero temperature. It is the chemical potential at zero temperature.
Consider a system with discrete energies, with $N$ occupied levels and at $0\, \mathrm K$. The Fermi-Dirac distribution is given by
$$n=\frac{1}{\exp\left(\frac{E-E_F}{kT}\right)+1},$$
where $E_F$ is the Fermi energy. The occupation of the $N$th level is $1$ and from the above equation this gives $E_N<E_F$ when taking the limit $T\rightarrow 0$. On the other hand, the occupation of the $(N+1)$th level is $0$ which leads to $E_{N+1}>E_F$. Hence,
$$E_N<E_F<E_{N+1}.$$
In particular, for insulators and semiconductors the Fermi level shall be in the gap between the valence band (whose last level is $E_N$) and the conduction band (whose first level is $E_{N+1}$). Note that only for continuum levels the Fermi energy is equivalent to the energy of the highest occupied level at zero temperature.
A: What you call Fermi energy is mostly called Fermi level in semiconductor physics. This Fermi level is synonymous with the total chemical potential of the electrons in the semiconductor which is a purely thermodynamic concept. This chemical potential needs not correspond to an allowed energy level of the electrons. See Fermi level.
