Act 1 Scene 1 of any play, especially a Shakespearean play, establishes the tone of the play and the background situation of the setting. It is important to remember that in Shakespeare's theatre, the Globe, there are no lights to dim to signal the start of the play, so the characters would need to enter center stage and just start talking. Shakespeare usually opened his plays with minor characters so that the audience was primed and ready for the revelation of the major characters and the major conflicts of the play by scene 2. The theatre would have settled down and been ready for the big story by then.
In this play, scene one has four minor characters, guards of Elsinore castle and Hamlet's best friend Horatio, talk about the strange occurrence they have seen two times before. The guards report to Horatio that they have seen a ghost that looks like the late King Hamlet. Horatio, as a university student and a scholar, is brought out to make sure they aren't just imagining things. At first Horatio is skeptical, but once the ghost actually appears, he is a believer. He attempts to command the ghost to speak, but the ghost merely appears and then disappears again. The men decide that they MUST tell Hamlet the disturbing news that a ghost like his father wants to see him.
The scene also serves as a means for the Horatio to explain to the guards why there has been a recent increase in military activity around the castle. Horatio reports that the young Prince Fortinbras of Norway has "sharked up a list of lawless resolutes" to attack Denmark in an attempt to regain lands that his father lost to King Hamlet several years before.
By the end of the scene, we have established the external conflict with Norway and the internal trouble that is suggested by the appearance of the ghost. A Renaissance audience would have believed that the ghost comes for some terrible reason -- never anything good. This scene is essential to establishing this background information. Once the audience has all of this information, they are ready to meet Claudius, Hamlet, Gertrude, Polonius and all of the other significant characters in the next scene.