Did Shakespeare act in any of his plays and if so, what roles did he perform?
The real answer to this question is that, while we know that Shakespeare was a respected actor and was writing plays at the same time as he was a member of The Chamberlain's Men, an acting troupe of high repute, we do not know which roles he may specifically have played. In the introduction to the First Folio, there is a list of "the principall actors in all the plays," the chief of whom is William Shakespeare himself. Therefore, we can be fairly sure that Shakespeare did indeed act in some or all of the plays contained in the First Folio, but we have no concrete information as to which roles he may have inhabited.
Nicholas Rowe, an actor who went on to write the first critical edition of Shakespeare's works, referred to Shakespeare as "the Ghost in his own Hamlet." However, this could equally have been meant metaphorically, rather than literally: we might read this to mean that Shakespeare put much of himself into the background of all his great plays, but never stole the spotlight.
Shakespeare began his career in the London theater as an actor. We can be reasonably certain of this because a critic of his first play, Robert Greene, wrote a highly unfavorable review in which he stated that it was presumptuous of a "mere actor" to write a play. Shakespeare's name appears in the cast lists of the Chamberlain's Men acting company, but no corresponding role(s) are given. Many scholars believe that Shakespeare did perform the role of Edward I in play by George Peele. The name of William Shakespeare also appears on the cast list of a play by Ben Jonson staged in 1603. But we have no firm evidence that Shakespeare ever performed as a character in any of his own plays. Local tradition has it that Shakespeare may have performed the parts of Henry IV in Henry IV: Parts 1 and 2, of Duncan in Macbeth, and of the Ghost of Hamlet's father in Hamlet. Another set of indirect evidence indicates that he performed the role of Old Adam, the faithful servant of As You Like It. Taking all of this together, the loose impression is that Shakespeare filled in in the parts of older male characters/authority figures. Again, we can conclude that Shakespeare occasionally acted during the first decade of his career as a playwright, that he probably acted in some of his own works, but that we don't really know what parts he performed in his own plays or (with the exception of Peele's Edward I) those of his fellow authors.