What was the attitude of people in Hamlet's day toward law and order and revenge?
Hamlet spends the first half of the play ensuring that the revelations of the ghost are in fact true. During Shakespeare's age, it was a common thought that ghosts could be coming to provide news (like in this case) or could be a devil in disguise of a loved one to cause harm. Hamlet needs to make sure that Claudius is in fact guilty of murder, or else Hamlet's revenge would be considered murder and he would be the law-breaker. He is concerned with the law of the land as well as God's laws. Revenge for murder was considered honorable in Hamlet's age, but it is murder, and that is troubling, especially to Hamlet. There were actual laws on the books in regards to these kinds of situations -- note the reference listed below.
The "law" during the "Middle Ages" was a flexible thing, that depended on whose jurisdiction you fell in. There was the local Lord's law, which might differ from the King's law which could be different from the Bishop's law. But the one code of law that many were familiar with was "The code of Hammurabi". This was a very early set of laws, that was quoted in the Christian Bible, and talks about the penalties for different crimes. This is where we get the "eye for and eye, and tooth for a thooth" concept. It expressly talks about if you take a life, you should forfeit your own. This allowed any individual to be justified in taking revenge.