I'm just launching into Last Man in Tower by Aravind Adiga. I don't think it is too much of a SPOILER to say that this novel focuses on the conflict between a developer in Mumbai who wants to buy out an entire apartment building and a retired -- and widowed -- school teacher, Masterji, who refuses to sell. The cover flap indicates that this becomes a murder mystery (and Masterji has a bunch of Agatha Christie and Erle Stanley Gardner mysteries in his apartment), though I suspect it is much more in the style of Gadda's That Awful Mess on Via Merulana, where the mystery is somewhat secondary to exploring a slice of society. (So far it seems I am the only one that has made this connection, and perhaps it doesn't hold up...) I'm not even certain that it is Masterji who ends up dead, though he certainly seems the likely candidate, since he is preventing the other tower residents from receiving a huge windfall payout.
The book shifts around a bit, and one thing it does is to explore Masterji's past and his current fraught relationship with his daughter-in-law to explain why he is so unbending and a bit of a grump.
This led me to think about how frequently grumpy or curmudgeonly characters turn up in literature, and how there are three main ways that they are used. The most common is simply to be a mouthpiece for the author's somewhat unpopular views, particularly as they get older, and here I would certainly include Saul Bellow, Kurt Vonnegut, Robert Heinlein, and arguably William Wordsworth. I simply haven't read enough of Philip Roth's late works or the last few of Updike's Rabbit novels to judge if they qualify, though there is a strong chance that they would.
The second approach is to show how the disappointments of life accrue over time and lead to a grumpy, even embittered, character. I'd say Dickens's Scrooge is a classic example and then the creepier case of Miss Havisham from Great Expectations (and then I suppose Emily Grierson, from Faulkner's "A Rose for Emily"). Other relatively well-known characters in this vein are Balzac's Père Goriot, Némirovsky's David Golder, and most of the lead characters from the later half of Bellow's career, particularly Arthur Samler, who is a Holocaust survivor (and it goes without saying that such characters are often understandably gloomy). I'm sure I've missed dozens, and feel free to add your own favorite examples of grumps in the comments. I actually just recalled Aubrey Tearle from The Restless Supermarket, though he would fail on the basis of being from an obscure novel, even slightly more obscure than Last Man in Tower. The hermit from Stoppard's Arcadia might count, but Stoppard doesn't actually give him any lines to recount life's bitter ironies.
Sometimes the emphasis is on how these grumps don't fit within today's society, and sometimes the emphasis is more on the path through life that brought them to this stage. (As an aside, I'm sure it's harder to come up with characters who have suffered great disappointment and/or loss and still do not become curmudgeons. One particularly notable example is found in R. K. Narayan's The English Teacher, which incredibly enough is drawn on events from his life. Elie Wiesel is another artist (who sadly left us this year) whose work transcends despair.)
Finally, the third general use of these grumpy characters is to show how an intervention or extensive kindness can redeem them and bring them back into the fold as it were. Once again, Scrooge is the exemplar of this approach. It is hard to write this storyline and not become too sentimental, at least in my view. I think in today's fairly cynical society, these redemption stories just don't ring particularly true. No question I found Eliot's Silas Marner unbearably mawkish, though Silas was more of a loner than a full-blown grump. I'm struggling to think of other examples, but mostly because I don't read "uplifting" fiction as a general rule. (And at least for now, I am not counting film or TV grumps who are redeemed.)
If anything else comes to me, I'll add it below, but again feel free to make suggestions in the comments.