Qoheleth turns to the study of human nature in its wisdom and its folly. Though all is vanity yet wisdom is better than folly; it is better to face the outlook, dreary though it be, with intelligence, than to be stupid and dense. The wise man can at least see where he is going; the fool is in a fog, and blind; the eyes of his understanding are darkened. Yet there is no final advantage to the wise, the same death overtakes both wise and foolish, so that unusual wisdom is really a useless endowment. Wise man and fool are alike buried in oblivion (cf. Ecclesiastes 1:11). So I hated life, yet he continued in it. A pessimist who is able to vent his feelings in literary expression does not commit suicide (Barton).
Ecclesiastes 2:12-17
12 And I turned myself to behold wisdom, and madness, and folly: for what can the man do that cometh after the king? even that which hath been already done.
13 Then I saw thatc wisdom excelleth folly, as far as light excelleth darkness.
14 The wise man's eyes are in his head; but the fool walketh in darkness: and I myself perceived also that one event happeneth to them all.
15 Then said I in my heart, As it happeneth to the fool, so it happeneth even to me; and why was I then more wise? Then I said in my heart, that this also is vanity.
16 For there is no remembrance of the wise more than of the fool for ever; seeing that which now is in the days to come shall all be forgotten. And how dieth the wise man? as the fool.
17 Therefore I hated life; because the work that is wrought under the sun is grievous unto me: for all is vanity and vexation of spirit.