i need help with how to initially explain who the character is, what she is doing? and some ideas on what the gentlewoman can be thinking about as she is leaving the castle after Lady Macbeth dies.
In addition to the prior responses, historically "gentlewomen" acted in the same way that late 19th/early 20th century "governesses," or 21st century live-in maids. The best 21st century comparisons may be Alice from The Brady Bunch, Mr. Belvedere, or Geoffrey from Fresh Prince of Bel Air.
These gentlewomen generally served the head females of a royal or aristocratic family. Oftentimes these women would be with the same family throughout generations; a gentlewoman may help raise a princess to a queen and then to her princesses alike. To put the generational aspect into perspective, think of the character of Nelly Dean from Wuthering Heights; she raises Heathcliff and Catherine I, then goes on to raise their children, and presumably Catherine II's children as well. As a result, it would be fair to assume that the gentlewoman in Macbeth had sincere care for Lady Macbeth, as it is very likely she watched Lady Macbeth grow from a strong woman to a woman plagued with the nightmares resulting from vociferous guilt. She demonstrates her concern by requesting the presence of the doctor and her promise to not repeat what she has seen. From this we can assume either great fear on the part of the gentlewoman, or great loyalty. The tone of the text in V.i. disparaging and heartbroken, leading the reader to believe the gentlewoman had sincere care for Lady Macbeth.
That she, indeed, cares personally for Lady Macbeth is evidenced by the gentlewoman's having called upon the physician to watch her at night. When the physician has done so for two nights and witnessed nothing, he questions the gentlewoman, who testifies that since "his majesty went into the field," she has opened her closet, written on paper, folded it, and sealed it."
Not having witnessed the gentlewoman in any other scene, the reader cannot be certain whether it is from loyalty or fear that the gentlewoman will not repeat what she has heard Lady Macbeth say "having no witness to confirm my speech." For, although she apparently cares for Lady Macbeth, at the same time as a mere servant she may have some trepidation about becoming involved in any way with regicide, an offense that dealt death as punishment.
This gentlewoman is probably some servant or, more likely, one of Lady Macbeth's Ladies in Waiting. She has seen what she wishes she had not seen--her queen sleepwalking and sleeptalking in the middle of the night--on a regular basis. She is obviously both faithful and concerned. She does call the doctor for help; however, when he asks specifically what she's seen and heard, she remains tight-lipped. Obviously she has surmised from watching and listening that Lady M is suffering the pangs of guilt from Duncan's murder. Killing a king was a sin deserving eternal damnation, so this is a weighty secret both to hold and to learn. She says,
The gentlewoman understands the weight of her lady's guilt and punishment. We have no more from this character, but after Lady Macbeth dies, she certainly has to be praying for her eternal soul, as she has committed two grievous sins against God. Because she does seem to genuinely care for her, I doubt she's leaving her service with joy in her heart.