Horatio is Hamlet's faithful, reasonable friend in Hamlet by William Shakespeare. In many ways he is Hamlet's foil, representing everything Hamlet is not. Rather than immediately accepting his friends' word that the ghost of King Hamlet has been appearing, for example, he goes to see for himself; even then, he has to think things through before he concludes that it is the ghost of the dead king and before he will bother Hamlet with the news of these sightings.
Throughout the play, Hamlet consistently relies on Horatio as a reasoned, intelligent, and loyal friend. Though Hamlet is rather secretive about his plans, he tells Horatio more than he tells anyone else. In terms of the play within the play, Hamlet has made an arrangement with the players to add some lines to the play, lines which will, he hopes, cause the king to admit his guilt. This is what Hamlet asks Horatio to do:
There is a play to-night before the king;
One scene of it comes near the circumstance
Which I have told thee of my father's death:
I prithee, when thou seest that act afoot,
Even with the very comment of thy soul
Observe mine uncle: if his occulted guilt
Do not itself unkennel in one speech,
It is a damned ghost that we have seen,
And my imaginations are as foul
As Vulcan's stithy. Give him heedful note;
For I mine eyes will rivet to his face,
And after we will both our judgments join
In censure of his seeming.
He asks Horatio to watch Claudius carefully, just as he intends to do. He hopes that the king will somehow react out of guilt for what he sees, and he wants Horatio to observe the king and tell him later, after the play, what he thought.
While this is a plan, it is a most imperfect plan, as it is based on emotions and interpretations rather than on any real evidence or facts. Despite that, the king reacts rather violently, the two men both agree that what this means is that the king is, indeed, guilty of murdering his brother. Ironically, this imperfect evidence is enough to finally give Hamlet the resolve to kill Claudius and he has the chance to do it; however, he is unwilling to act because Claudius is in the act of confession. Even when he is convinced and has corroborating evidence, Hamlet is unable to act.