I should certainly have never been able to do anything from being magnanimous – neither to forgive, for my assailant would perhaps have slapped me from the laws of nature, and one cannot forgive the laws of nature; nor to forget, for even if it were owing to the laws of nature, it is insulting all the same. (1.2.4)
It's interesting that the Underground Man "cannot forgive" the laws of nature; bashing his head against the stone wall, then, would seem to be symbolic of a thwarted attempt at revenge.
Finally, even if I had wanted to be anything but magnanimous, had desired on the contrary to revenge myself on my assailant, I could not have revenged myself on any one for anything because I should certainly never have made up my mind to do anything, even if I had been able to. (1.2.4)
How can we reconcile this thought with the Underground Man's attempts at revenge in the second half of Notes?
Now let us look at this mouse in action. Let us suppose, for instance, that it feels insulted, too (and it almost always does feel insulted), and wants to revenge itself, too. […] through his innate stupidity the [man] looks upon his revenge as justice pure and simple; while […] the mouse does not believe in the justice of it. To come at last to the deed itself, to the very act of revenge. […] the luckless mouse succeeds in creating […] doubts and questions, […] there inevitably works up around it a sort of fatal brew, a stinking mess, made up of its doubts, emotions […]. Of course the only thing left for it is to dismiss all that with a wave of its paw, and […] creep ignominiously into its mouse-hole. (1.3.2)
The mouse's inability to exact revenge is an illustration of the Underground Man's inability to act: both are the result of hyper-consciousness.
There in its nasty, stinking, underground home our insulted, crushed and ridiculed mouse promptly becomes absorbed in […] everlasting spite. For forty years together it will remember its injury down to the smallest, most ignominious details. […] Maybe it will begin to revenge itself, too, but, as it were, piecemeal, in trivial ways, […] knowing that from all its efforts at revenge it will suffer a hundred times more than he on whom it revenges itself. (1.3.2)
This is in fact the fate of the Underground Man. He doesn't explain, however, why he harbors his spite when revenge is unavailable to him. Why not dismiss spite all together?
I did not slink away through cowardice, but through an unbounded vanity. […] What I was afraid of was that everyone present […] would jeer at me and fail to understand when I began to protest and to address them in literary language. […] Of course, this trivial incident could not with me end in that. I often met that officer afterwards in the street and noticed him very carefully. I am not quite sure whether he recognised me, I imagine not; I judge from certain signs. But I – I stared at him with spite and hatred and so it went on ... for several years! My resentment grew even deeper with years. (2.1.19-20)
The Underground Man's plans for revenge are unrealistic literary inventions. For this reason, they are doomed from the start; if others cannot understand his literary language, they will surely not understand why they should be insulted.
In this way everything was at last ready. […] It would never have done to act offhand, at random; the plan had to be carried out skilfully, by degrees. But I must confess that after many efforts I began to despair: we simply could not run into each other. I made every preparation, I was quite determined – it seemed as though we should run into one another directly – and before I knew what I was doing I had stepped aside for him again and he had passed without noticing me. […] One time I had made up my mind thoroughly, but it ended in my stumbling and falling at his feet because at the very last instant when I was six inches from him my courage failed me. (2.1.28)
This thwarted attempt at revenge perfectly encapsulates the Underground Man's character: all thought, all talk, no action.
They would abandon Zverkov, he would sit on one side, silent and ashamed, while I should crush him. Then, perhaps, we would be reconciled and drink to our everlasting friendship; but what was most bitter and humiliating for me was that I knew even then, knew fully and for certain, that I needed nothing of all this really, that I did not really want to crush, to subdue, to attract them, and that I did not care a straw really for the result, even if I did achieve it. (2.3.40)
Come to think of it, the entire notion of revenge is literary and idealistic to begin with, as we see here.
"I am going there!" I cried. "Either they shall all go down on their knees to beg for my friendship, or I will give Zverkov a slap in the face!" (2.4.99)
The Underground Man suffers from his own extremism: it has to be either forgiveness or revenge; heroism or slavery; best friends or mortal enemies. There's no middle ground.
"Drink your tea," I said to her angrily. I was angry with myself, but, of course, it was she who would have to pay for it. A horrible spite against her suddenly surged up in my heart; I believe I could have killed her. To revenge myself on her I swore inwardly not to say a word to her all the time. "She is the cause of it all," I thought. (2.9.21)
The Underground Man uses notions of blame, spite, and revenge to compensate for his own character flaws and to distract himself from his own failings.