Wisdom Literature
People in ancient Israel loved books about how to be wise: Job, Proverbs, and Ecclesiastes are usually grouped as the three books that are supposed to really get at wisdom and show what it means. Job is a story, but Proverbs and Ecclesiastes are collections of pithy sayings, so you get a little of everything from Wisdom Literature—sort of like those Chicken Soup for the Soul books, except from over two and a half millennia ago.
The Book of Job first asked the really important question, "Where shall wisdom be found?" (28:12). Not only do Ecclesiastes and Proverbs try to answer this question, but so do other books from the Apocrypha, outside the canon of Biblical books accepted by everybody—books like "Ecclesiasticus" and "The Wisdom of Solomon." Robert Alter—a major authority on the Hebrew Bible—says that the Wisdom books are different from most of the other books in the Bible because they are usually meant to apply, not just to the situation of Israel, but to the entire world. They're meant to be relevant anywhere, at any time.
But while the book of Proverbs presents wisdom that's more in line with the rest of the Bible—for example, it wouldn't say that more wisdom leads to more sorrow and grief—Ecclesiastes does say those kinds of dark, disturbing things. It doesn't just offer up wisdom. It offers up a weird, bizarro wisdom that runs against what a lot of people at that time would've thought wisdom really was. (Source)