There basically is nothing new under the sun, and there have already been quite a few scholars that have probed the literature of boredom. Certainly, the most extensive look into this area is Richard Kuhn's The Demon of Noontide: Ennui in Western Literature. Despite what it says on the title, he probes a variety of forms of boredom, not only the ostensibly Continental ennui.
If we look at earlier novels and works of fiction, there is clearly a religious connotation: idle hands are the devil's playthings and so forth. This is basically how Hawthorne and Melville would have conceptualized boredom. While boredom isn't really a sin, boredom is likely to lead to sin.
Flaubert's Madame Bovary generally would fall into this category as well (of acting badly largely due to boredom), though perhaps there are the seeds of ennui in her somewhat tawdry story.
Anyway, there was considerable effort, particularly by French authors, that went into exploring this state of ennui and lassitude, which in its most extreme forms could lead to suicide.* In many cases, the dissolute French poets (Baudelaire and Racine chief among them) went slumming to try to dispel boredom.
I have not read them, but if I do feel like making a further dive into ennui and "mal du siècle," these are perhaps the best two texts: François-René de Chateaubriand's René and Alfred de Musset's La Confession d'un enfant du siècle (Confession of a Child of the Century).
I'm sort of tempted to pull together a shelf of these types of books and call it The Library of Boredom. In addition to some of the books listed below, I would include the relatively obscure existential novel The Tartar Steppe by Italian author Dino Buzzati.
There seems to be a bit of a split in the literature of the 20th Century. Relatively few American authors write about boredom at work** (at least I am having trouble thinking of any that write about office work), but quite a few wrote about suburban ennui that took place on the home front: John Cheever, John Updike, Richard Ford (The Sportswriter/Independence Day/The Lay of the Land) and Jonathan Frazen's The Corrections (though personally I found this unstomachable and stopped partway through). It may also be somewhat cyclical, and in tougher economic times, there may generally be fewer stories centered around boredom, as everyone is just supposed to be so grateful to have a job at all (and the unemployed are too busy surviving to be bored about their situation). If this is so, then we are about to enter a period where we long for the "golden age" when authors could still write about boredom in a non-ironic sense.
Saul Bellow was one of those writing in this previous age, though I would argue he mostly wrote about people who seem to go to great lengths to escape boredom (I'd put both Herzog and Henderson in this category), and while I disliked the novel, Mickey Sabbath from Philip Roth's Sabbath's Theater, takes this avoidance to extremes. Unfortunately, I have not been able to read this paper (behind a paywall - sorry) where the author posits a link between Dostoevsky and Saul Bellow in exploring boredom.
I have to say that seems sort of strange, since I can recall not only Dostoevsky but Tolstoy and Gogol writing at least a bit about the boredom of working in offices, but I don't recall Bellow's characters holding down 9-to-5 jobs for the most part.
Anyway, I can think of far more Russian examples of the tedium of office work, which often did drive the characters to the brink of madness and beyond. One example from Trinidad is Edgar Mittelholzer's A Morning at the Office. If I've missed any good examples of novels, particularly English language novels, that really delve into the boredom of office work, feel free to add in the comments.
The rest of the post will briefly feature David Foster Wallace's The Pale King. As I mentioned before, this is a somewhat sad novel with many references to suicide throughout (including people who feel driven to suicide by the tedium of their profession). I just can't help but feel that this was all an elaborate cry for help, and it's unfortunate he didn't share this material with more people. Leaving that aside, the novel is an odd, patchy thing where there are long chapters devoted to getting inside a single character's headspace and shorter pieces where arcane bits of lore about the IRS are revealed. While I'm fairly sure David Wallace didn't actually work for the IRS (as the "David Wallace" character in the book claims), he was boning up on accounting in order to write about an IRS office in downstate Illinois in the 1980s. (I wonder if he found, as I have, that it can be incredibly difficult to get information about everyday life in the 80s, since it all is just before the dawn of the internet age where everything started to be documented on-line.) Anyway, here are a couple of reviews that give a pretty good sense of what reading the novel is like: NYTimes and Guardian.
I think it is fair to say, this is a novel only for dedicated DFW fans. Nothing serious happens in the novel, and that was intentional. Wallace wanted a novel that focused on the boredom and drudgery of being an IRS inspector and that, several times, some big turning point in the plot would arise, and then it would fade away. Almost like Waiting for Godot blown up to close to 600 pages. I would say that the fact that the author makes it entirely clear this is a book about boredom (not just once but twice) is a real weakness. In general, there is just too much drawing the reader's attention to the artifice of fiction throughout the novel (especially the footnotes, which I find incredibly tedious but DFW fans seem to love) and the announcements about boredom are another prime example. I'm reasonably glad I read the book, but for me it would have functioned better at shorter length, and honestly I liked the earlier material better than the later material (which got more mystical), which suggests I probably would have liked this less if he had lived to finish it... Anyway, it is definitely the most monumental work dedicated to boredom I am likely to tackle and actually finish.
Edit (1/15/17): This may be unnecessarily mean, but DFW fans strike me as the most insufferable literary snobs out there, insisting that the only thing wrong with Infinite Jest was that "the market" forced Wallace to prune the thing at all. None of us are worthy to question the great DFW. I am extremely resistant to such idolatry and generally it puts me off the author in question. I personally find the footnotes kind of insufferable and certainly the least interesting thing about The Pale King, so I'm pretty sure I will never read Infinite Jest.
* It's been a really long time since I've read Goethe's The Sorrows of Young Werther, but if I recall the suicide in this novel is tied to romantic disappointment and not to ennui.
** English authors also seem to avoid writing much about the workplace (probably to avoid boring their readers). The early comic novels Diary of a Nobody and Three Men in a Boat make it clear that their characters are fairly low-level clerks or office functionaries, but part of the comedy is watching them try to inflate their importance outside the office. Relatively few scenes take place while they are on the clock so to speak. Maybe some of Graham Greene's work would qualify.