Answer: To lend proof to the story of the two guards that they have spied a ghost.
Step-by-step explanation:
Horatio was among the guards in the opening scene so that he can lend proof to the story of the two guards that they have spied a ghost.
Horatio never had the belief that there were ghosts, therefore the guards told him to come along so that they can show him King's Hamlet ghost and therefore make him believe that there were ghosts.