You know how all of Stephen King's books are about writers? Or how an unlikely number of movies have writer characters? Sometimes people take the advice to write what you know pretty literally—like Shakespeare, who filled Hamlet with self-conscious references to the workings of the theater. But it's not just for lack of other material. Hamlet is self-reflexive: it constantly draws attention to the fact that it's a play. By taking on various theatrical roles, like "antic" or "revenge hero," Hamlet is pushing us to ask just how much of our identity is based on performance. Have you ever used a line from a movie as a Facebook status? Or quoted a song when a conversation gets a little too real? Then you know what we're talking about.
In Hamlet, theater is exactly what Hamlet says it is: a faithful reflection (a "mirror") of what's going on in the world.
Hamlet defines theater as an art designed to "hold, as 'twere, the mirror up to Nature" (3.2.1). But in Hamlet, Shakespeare presents theater as something that shapes reality, rather than merely reflecting it.