This is a very broad question to answer, because there were so many people and movements that influenced Shakespeare. In light of this let me name a few of them.
First, classical literature influenced Shakespeare. He knew his Latin and Greek authors well. He was able to write tragedies, because of the great Greek tradition of Sophocles, Euripidies and others. He was also to write works like Julius Caesar, because he knew the Roman corpus as well. Also Roman poets like Ovid had a great influence on him. In light of all these points, it can be argued that classical literature influenced him the most.
Second, the Renaissance was in full swing by the time of Shakespeare. In fact, he comes at the tale end. So, all the humanistic learning of the Renaissance has influenced him as well.
With these things stated, it is also important to note that all masters recreate things and make them their own. So, we must not under-emphasize his creative abilities.
One of the major sources of information that Shakespeare drew upon in the creation of Macbeth was Holinshed's Chronicles, a history which detailed the lives of the real Scottish Kings Duncan, Macbeth and Malcolm (not entirely accurately).
In common with other playwrights of his time, Shakespeare was heavily influenced by ancient Greek theatre. This can be seen in his creation of noble but flawed tragic heroes, following a tradition which originates with Aristotle.
Shakespeare was also influenced by the monarchs of his day - Elizabeth I and James I of England (James VI of Scotland) and the need to gain favour with the royal court in order to survive and thrive in the competitive world of Elizabethan theatre. It is well documented, for example, that James I was deeply interested in witchcraft and this had some bearing on Shakespeare's inclusion of the supernatural in Macbeth. Histories of Elizabeth I's Tudor ancestors were designed to glorify the achievements of the queen's forebears and gain her favour.