Macduff, in Shakespeare's Macbeth, is caught in the middle of Macbeth's evil scheming to take the throne and keep it. Macduff appears first when Duncan has been murdered.
Macduff's suspicions may first appear in learning that Macbeth killed the alleged murderers of the King (his guards). When Macbeth says he is sorry he killed them, Macduff asks why he did it? (They were the only "lead" they had in figuring out who was behind the plot to kill Duncan, for the men believe the guards did not act on their own.)
O, yet I do repent me of my fury,
That I did kill them.
Wherefore did you so?
Who can be wise, amazed, temperate and furious,
Loyal and neutral, in a moment? No man:
The expedition of my violent love
Outrun the pauser reason. (II.iii.117-123)
Along with the others, Macduff calls for an investigation—the King's murderer must be found.
Macduff is also seemingly suspicious when he and Ross discuss the burial of Duncan and Macbeth's crowning as King, as Malcolm and Donalbain have fled (for safety, though certainly Macbeth is spreading the rumor that they are behind their father's death—he will eventually refer to them as his "blood cousins").
There may be an inkling of doubt when Macduff repeats once again that the guards were murdered by Macbeth. He then takes his leave of Ross, noting that he hopes they do not soon wish for the days when Duncan was alive as opposed to being Macbeth's subjects (as he refers to robes):
Well, may you see things well done there, Adieu,
Lest our old robes sit easier than our new! (II.iv.49-50)
However, everyone (including Macduff) soon comes to realize that those closest to Macbeth end up dead. The Scotland of Duncan's time is gone. Macduff's suspicions grow, so he goes to England.
When Macduff leaves Scotland for the country where Malcolm (Duncan's heir) is living for safety's sake, even Malcolm questions Macduff's intentions for being there. For how could an honest man feel he could comfortably leave his family behind without threat from Macbeth unless Macduff were working for Macbeth?
In his desire to save Scotland (similar to Brutus' desire to preserve Rome at all costs when he murders Caesar in Shakespeare's Julius Caesar), Macduff acts foolishly by leaving his family unguarded. When Macbeth learns about Macduff's departure to England (where Macbeth's enemy, Malcolm, resides), he is sure that Macduff has taken up with Duncan's son, and orders the murder of all of Macduff's family and household.
Macduff's devastation over their deaths—along with his initial disgust when he believes Malcolm would be a far worse tyrant on Scotland's throne than Macbeth (which he later learns is untrue)— convinces Malcolm that Macduff can be trusted. With soldiers and arms provided by Edward the Confessor of England, Malcolm and Macduff return to Scotland to take the throne forcibly from Macbeth.
So Macduff facilitates Macbeth's continued evil in leaving his family unattended, allowing the new and evil King to kill Macduff's wife and children; at the same time, however, he prevents further evil by returning with Malcolm to take Scotland back. It is, in fact, Macduff who kills Macbeth specifically with the intent of avenging the deaths of those dear to him.
Then yield thee, coward,
And live to be the show and gaze o’ the time.
We'll have thee, as our rarer monsters are,
Painted upon a pole, and underwrit,
“Here may you see the tyrant.” (V.viii.27-31)