I've recently been thinking about Shakespeare and Popular culture, both the popular culture of Shakespeare's day (the culture of the people, manifested in various ways) and though unrelated to this post the popular culture of today. In one of the chapters of Shakespeare and Elizabethan Popular Culture David Margolies suggests that Hamlet may be a bit of a remake of another well-liked revenge play of the day called Hamlet and that a book, or a work of fiction, called Tom a Lincoln by Richard Johnson may have added "new significance."(pg 125) I don't really understand, though, how a book described as "being shallow and disconnected" (Pg. 125) could add that significance. If we knew more about the original Hamlet then it would be a lot easier to say.
There are similarities between the two stories.
1. A ghost speaks to his son and demands his son revenge his murder.
2. The son swears revenge, grandly, and "bemoans the profitless use of his time" (pg 126)
3. Evidently there's a somewhat similar graveside speech in both.
4. The son's mother is in a sexual relationship with the father's murderer.
5. The son kills a man in his mother's chambers, thinking it might be his mother's lover, and the mother is distressed.
This fifth point is the one Margolies considers the most significant. The son in Tom a Lincoln first kills his mother's lover while they were asleep in bed, and then fights with himself and his guilt as to whether it is better to spare his mother's life or to avenge his father's death before killing his mother. Hamlet's mother seems, it has been said to have "fear in excess of any threat Hamlet's anger seems to pose" (pg 127) when she calls out "What wilt thou do? Thou wilt not murder me? / Help, ho!" and this fear could be chalked up to Shakespeare playing with the audiences awareness of this popular work of fiction, where the son did kill his mother in somewhat similar circumstances.
I have no idea how much Shakespeare drew from anything, and when we have no record of what is believed to be his primary source, it becomes even more difficult to say anything about where Shakespeare got his ideas and what he modified. It is very possible, though that Shakespeare took the play Hamlet that was already popular, and played with the similarities and possible similarities of another piece of popular culture to create a great play that has fascinated people for a very long time.