Is there a molecule which behaves as both nucleophile and electrophile?
Not at the same time, but I can think of benzene as one example. I can't imagine any other examples, though.
Two major types of reactions that involve benzene are electrophilic aromatic substitution reactions (EAS) and nucleophilic aromatic substitution reactions (NAS).
One example of EAS is the Friedel-Crafts Acylation, in which benzene acts as a nucleophile in the presence of an acyl chloride and
and one example of NAS is the
You might say, "well wait a minute, can we do that?" Yes, we can; this can be justified by the resonance stabilization this molecule has: