In the Elizabethan Age, awareness and fear of the supernatural was very real and Shakespeare plays on this awareness and fear in his plays. The appearance of ghosts were seen as portents of doom and devastation, a reversal of the natural order. Their appearance implied a desire to do or complete an unfinished task, and they were generally perceived as 'evil'.
In this context, therefore, Hamlet's friends fear for his safety and wish to protect him against the uncanny, especially because the ghost is dressed in armour, and appears in the guise of the slain King Hamlet - this, to them implies its motive to firstly deceive Hamlet and then attack him, as it were. They need to protect him but are, however, fearful of confronting the ghost themselves and therefore, Horatio, his closest and most loyal friend, urge him not to follow it.
First of all, it is worthy to note that in the Elizabethan Age, there was a strong belief in the supernatural; ghosts, for instance, were thought to have died of horrific circumstances, so they were to be feared. (Interestingly, in one of the paradoxes of this play, Hamlet's ghost comes from Purgatory where he is confined in fire until his "foul crimes" are "burnt and purged away." But, later in the drama, Hamlet resists killing Claudius while he prays because by murdering him in prayer, Claudius will have his sins purged. This doctrine pertaining to King Hamlet is a Roman Catholic one while Hamlet's belief in a "leap to grace" is a Protestant one.)
Clearly, there is a conditioned fear in Hamlet's friends when they see the ghost in Act I, Scene 1, especially as he appears to be King Hamlet dressed in his war armor which he wore when he defeated the King of Norway, Fortinbras. Horatio is concerned about this resemblance because King Claudius has returned to "this Fortinbras," the son, the lands that were taken by King Hamlet. In fact, Horatio notes, they are on guard to watch for an invasion from Norway. Horatio, then, suggests that he and the others tell Prince Hamlet about what they have witnessed.
***In Act I, Scene 4, the ghost reappears before Hamlet. After the ghost appears, he "beckons" the prince to follow him; Hamlet decides to do so because it will not speak, but Horatio begs him not to go. He cautions Hamlet that the ghost could do him some harm:
What if it tempt you toward the flood, my lord,
Or, to the dreadful summit of the cliff
That beetles o'er his base into the sea,
And there assumes some other horrible form
Which might deprive your sovereignty of reason
And draw you into madness? Think of it. (1.4.53-58)
Horatio is worried that Hamlet may drown in the ocean, he may fall from a cliff, or that he may be so terrified by a "horrible" shape that the ghost may assume that Hamlet loses his mind from the experience.
During Elizabethan times, people were very scared of the supernatural and ghosts. Most times this was seen as a bad omen and his friends did not think it was a good idea to follow the ghost. They believed that this ghost may in fact just be the devil trying to dress like his ghost in order to harm Hamlet.