Public goods and externalities are classic examples of market failures, where the unfettered market mechanism does not lead to a socially optimal outcome.