The play within the play is used by Hamlet to give him evidence against Claudius. Hamlet has not yet carried through with his plan to avenge his father's death. He blames himself and believes that this inaction is cowardly:
Am I a coward?
Who calls me villain? breaks my pate across?
Plucks off my beard and blows it in my face?
Tweaks me by the nose? gives me the lie i' the throat, As deep as to the lungs? Who does me this? Ha!
However, he also suggests, perhaps to make himself feel better, that he has no concrete evidence that Claudius is guilty. The Ghost may have been a "devil" and not to be believed:
The spirit that I have seen
May be a devil; and the devil hath power
T' assume a pleasing shape
Therefore, he uses the play to assure himself that Claudius deserves to be punished:
I'll have grounds
More relative than this. The play's the thing
Wherein I'll catch the conscience of the King.
The play does indeed do this. Claudius' reaction is enough to spur Hamlet into action. Unfortunately, that action quickly gets stymied then transferred into the mistaken murder of Polonius. But the play-in-a play provides the moment when Hamlet begins to move his thought into action.
This "internal play" is significant not just for the plot progression. It is also significant because, symbolically, the "acting" of the players mirrors, represents, the "acting" that is happening elsewhere: Hamlet "acting" mad, Rosencrantz and Guildenstern "acting" like friends, and Hamlet beginning to "act" upon his vengeance.