In Act 4,scene 5,what dramatic purpose is served by the madness of Ophelia? And scene 7, what qualities are brought out for Claudius,Laertes,Gertrude
At least in part, Ophelia's madness is there to show true madness. Just in case anyone should think that Hamlet is mad, Shakespeare presents us with a person who is really bonkers.
Like Hamlet, she has lost her father, but unlike Hamlet, she has also lost her wits. She acts strangely, is distracted, sings, then talks, cries, seems deeply troubled, and she can't stop the things that are botherering her mind from spilling out of her mouth. And, in the end, she ends what has become of her pathetic existence.
Laertes is presented in Act 4 to show us what revenge looks like. Without question or thought, he is ready to slit Hamlet's throat.
Yes, in many ways Ophelia and Laertes are a pair of characters that shine a light on one character: Hamlet. They are two extreme reactions to a father's murder that, in Hamlet, are co-mingled. Hamlet does his best to assimilate both his mad rage and his need to exact revenge in his own way.
Now I'm sure someone else will graciously give you an answer to the rest of your question.