Wikipedia says:
The probability density function is nonnegative everywhere, and its integral over the entire space is equal to one.
and it also says.
Unlike a probability, a probability density function can take on values greater than one; for example, the uniform distribution on the interval $[0, \frac{1}{2}]$ has probability density $f(x) = 2$ for $0 ≤ x ≤ \frac{1}{2}$ and $f(x) = 0$ elsewhere.
How are these two things compatible?