With its emphasis on the vanity of human existence, Ecclesiastes is one of the more bleak books in the Old Testament. I would say that the most frequently used literary device in this book would have to be parallelism. This occurs when words, phrases, or clauses balance each other out in an expression.
In the King James translation of the Bible, we find numerous examples of parallelism. In the fourth verse of the book's opening chapter, for example, we read the following:
One generation passeth away, and another generation cometh: but the earth abideth for ever.
Note the repetition of the word "generation" in the first two clauses. Notice also the balancing opposition of "One" and "another", as well as the opposition of "passeth" and "cometh." Several other examples of this occur in the verses that follow.
The most famous example of such parallelism occurs in the opening of Ecclesiastes 3, where we have the famous "To every thing there is a season" passage. Verses 2-8 are thick with parallelism. I shall cite verses 3 and 4 only here:
A time to kill, and a time to heal; a time to break down, and a time to build up;
A time to weep, and a time to laugh; a time to mourn, and a time to dance;
Note the echoing of the definite article ("A...a"); the repetition of the word "time", and the balancing of the infinitives ("to kill...to heal" etc.).
Thus, it would seem to me that parallelism is a dominant literary device in this book.