what is the purpose of Act 3 Scene 5
Actually, scene v, of Act III has three purposes. The first purpose is to reveal that the three witiches have been playing with the fate of Macbeth without Hecate's, the queen of witches, permission, and she is infuriated by it, for she calls them "beldams" which means disobedient hags, and tells them that Macbeth has been doing what he has for the "his own ends;" in other words, they will not benefit from what Macbeth is doing. Therefore, she orders them to set things straight again.
This leads to the second purpose of this scene, and that is the witches are ordered to undo, if you will, the spell of "Fair is foul, and foul is fair" that they have placed over Scotland. In other words, what is fair will be fair again, and what is foul will be foul again.
This brings us to the third purpose of this scene, and that is Macbeth's reign as king is now coming to an end, for the witches will meet him at the "pit of Acheron" in order to give him the three new prophecies that will ultimately lead him to his demise.