Oliver shares Duke Frederick's paranoid treachery when it comes to his brother, Orlando. Oliver would've lured Orlando into a death trap, yet Orlando actively works to save his brother even at the risk of his own life. When faced with the good Orlando has done for him, Oliver is so shocked by his own cowardly and paranoid actions that he has a change of heart, much like Duke Frederick eventually does.
Duke Senior is obviously more mature than Frederick (or else he wouldn't be named "Senior"). Senior is happy in the forest, reminded of how nice it is to live in one big snowy reality check, free from flattery and treachery. He's also got a good heart and welcomes starving Adam and Orlando at his table, even after Orlando bursts into the dinner party and acts like an animal. Frederick, by contrast, is the kind of guy who usurps his brother's title and then becomes consumed by the treachery he's committed. He kicks Rosalind out on the street for no good reason and he's ready to go after Oliver because of his connection to the boy's long-dead father.
We know, we know. We just said that a "foil" is a character. So, why are we talking about the play's two settings? Well, you did notice that the French court is a major contrast to the Forest of Arden, didn't you? After all, the forest is all about freedom and safety, while Duke Frederick's court is the kind of place where family members hire hit men to take down annoying relatives. Go to "Setting" if you want to think about this some more.