The purpose of this conversation between Gertrude and Hamlet is for Gertrude to try and determine what is going on with Hamlet. She starts out on the offensive, accusing him of offending his (step-) father, Claudius. Hamlet is already in high spirits having just missed an opportunity to kill Claudius before he enters his mother's rooms, and he is ready to say everything and anything that comes to mind. He even claims he wishes she were not his mother. When he mistakenly kills Polonius the Queen exclaims, "What a rash and bloody deed is this!" Hamlet seizes this opportunity to put out the idea of his father being killed and then watches Gertrude's reaction to the statement. By her reaction, he may be able to judge whether she has knowledge of Claudius' crime. He says, "Almost as bad...As kill a king, and marry with his brother." Gertrude's immediate response is, "As kill a king?" What she means is, "What are you talking about?" Because Hamlet doesn't pursue this topic further, we can conclude that he judges his mother to be innocent of the murder of King Hamlet. He proceeds to try and convince his mother to leave Claudius; he doesn't even hint to her about his knowledge of Claudius' actions.
When Hamlet is engaged in a discussion with Gertrude, they are sparring with words. She is talking about one thing, he another. She tells him he has offended his father very much (meaning Claudius, who is not his father), and he tells her that, no, madame, it is you who have offended my father - meaning by marrying Claudius. He then proceeds to say that it is an offense to have murdered a king, and she does not know what he is talking about - "Is the king dead?" she asks. She seems to be totally unaware that Hamlet is insinuating that Claudius has killed his father, and Gertrude's former husband. Hamlet has not been sure whether or not his mother knows about the murder, and in this scene, it indicates that although she is a huge air-head, she really did not know about Claudius' misdeeds. We are never really sure whether Gertrude has some knowledge of what happened, whether she is mentally unbalanced and is in denial, or she is just a huge airhead (this is my view). She truly seems not to know that her first husband has been poisoned by her current husband. Also, she does not know why Hamlet is so upset and if she knew about the poisoning, she would understand his strange behavior.