  The recent detection of delayed X-ray flares during the afterglow phase of
gamma-ray bursts (GRBs) suggests an inner-engine origin, at radii inside the
deceleration radius characterizing the beginning of the forward shock afterglow
emission. Given the observed temporal overlapping between the flares and
afterglows, there must be inverse Compton (IC) emission arising from such flare
photons scattered by forward shock afterglow electrons. We find that this IC
emission produces GeV-TeV flares, which may be detected by GLAST and
ground-based TeV telescopes. We speculate that this kind of emission may
already have been detected by EGRET from a very strong burst--GRB940217. The
enhanced cooling of the forward shock electrons by the X-ray flare photons may
suppress the synchrotron emission of the afterglows during the flare period.
The detection of GeV-TeV flares combined with low energy observations may help
to constrain the poorly known magnetic field in afterglow shocks. We also
consider the self-IC emission in the context of internal-shock and
external-shock models for X-ray flares. The emission above GeV from internal
shocks is low, while the external shock model can also produce GeV-TeV flares,
but with a different temporal behavior from that caused by IC scattering of
flare photons by afterglow electrons. This suggests a useful approach for
distinguishing whether X-ray flares originate from late central engine activity
or from external shocks.
