What is the importance of the entrance of the doctor (Act 4) at this time in "Macbeth"?
The doctor's significance in Act V is to show the extent of Lady Macbeth's guilt and the resulting damage to her conscience.
In Act V, scene 1, the doctor witnesses Lady Macbeth sleepwalking and talking about what she knows of the murders of Duncan and Banquo. She washes her hands in scene 1 and never can get the smell of blood and the spots of blood off her hands.
We also learn in this scene that Lady Macbeth always carries a light with her. It is as if she is afraid of the dark and the evils it carries with it.
Gentlewoman: Why, it stood by her: she has light by her
continually; 'tis her command. (V.1)
In ironic contrast, in the beginning of the play (I.5) Lady Macbeth calls on "you murdering ministers" and darkness to help her be brave and resolute in her murder plan.
Lady Macbeth: Come, you spirits / [...] / And fill me ... top-full / Of direst cruelty!... / [...] / ...you murdering ministers, / [...] / You wait on nature's mischief! (Act I scene 5)
The doctor also helps us to understand where the people of Scotland stand where Macbeth is concerned. He mentions that if he could get away, no amount of money in the world would bring him back.
Doctor: [Aside] Were I from Dunsinane away and clear,
Profit again should hardly draw me here. (Act V scene 3)
The doctor's thought is echoed in Act V, scenes 4 and 7, when we hear from Malcolm and Siward that warriors from Macbeth's army have abandoned him and are switching sides to fight with Malcolm's armies.
Malcolm: Both more and less have given him the revolt,
And none serve with him but constrained things
Whose hearts are absent too. (V.4)
Siward: [...]/The tyrant's people on both sides do fight;...
Malcolm: We have met with foes/That strike beside us. (V.7)