the Fermi level is shifted due to doping: Upwards in case of n-type and downwards in case of p-type.
Why is this?
The Fermi level is the level where the probability that an electron occupies the state is $0.5$, e.g. where the Fermi energy is located (correct?). I can understand that the distribution changes with the temperatures (it gets broader) but I don't understand why/how the Fermi level changes.
The Fermi energy is defined as:
$$ E_F = \frac{h^2}{2m_0} \frac{3 \pi^2 N}{V}^{3/2} $$
I can't see any “doping influence” in this equation. What moves the Fermi energy, and thus the Fermi level?
There are related questions like Why does Fermi Level change due to change in donor atom concentration? and Does the Fermi level depend on temperature? but they do not answer this question here.