f(x) is non-negative and integrates to 1 over its support. P(a < X < b) is the integral of f from a to b.
The trap. f(x) is not a probability and can exceed 1. Only the area under it is a probability, and the probability of any exact value is zero for a continuous variable.
Relationship to the CDF: the density is the derivative of the distribution function, and the distribution function is the integral of the density. For maxima and minima problems it is almost always faster to work with the CDF and differentiate at the end.