Immediately before the play's final battle, Macbeth learns that his wife has died by her own hand. He responds with one of Shakespeare's bleakest speeches:
Tomorrow, and tomorrow, and tomorrow
Creeps in this petty pace from day to day
To the last syllable of recorded time;
And all our yesterdays have lighted fools
The way to dusty death. Out, out, brief candle!
Life's but a walking shadow, a poor player
That struts and frets his hour upon the stage
And then is heard no more. It is a tale
Told by an idiot, full of sound and fury,
Macbeth's outlook heading into the battle, then, is one of existential bleakness, questioning the very meaning of life itself. But he is still hopeful of success, owing to the witches' prophecy. This, too, takes a hit when he learns from his messenger that Birnam Wood is apparently marching on the castle. After receiving this disturbing bit of information, he feels as if he is "tied to a stake," but resolves, "bear-like," to fight on. This is a reference to bear-baiting, a sport in which bears were tied to stakes and set upon by dogs. So he seems to accept the reality of his death, even as he remains confident due to the other half of the prophecy, namely that he can only be killed by a man who is not born of a woman. This hope, of course, is dashed when Macduff reveals that he was born by caesarian section, and Macbeth's reaction is interesting. He blames the witches for deceiving him, and tries not to fight Macduff. In the end, however, he chooses to fight to the death, fearing dishonor. So his mental state is complex and somewhat contradictory throughout the climactic battle.