  Gamma-ray bursts (GRBs), which have isotropic energy up to $10^{54}$ erg,
would be the ideal tool to study the properties of early universe: including
dark energy, star formation rate, and the metal enrichment history of the
Universe. We will briefly review the progress on the field of GRB cosmology.
Meanwhile, X-ray flares, which may have important clues to the central engine,
are common phenomena in the GRB afterglows. We present statistical results of
X-ray flares, i.e., energy, duration time and waiting time distributions, and
compare the results with solar flares. The similarity between the two kinds of
flares are found, which may indicates that the physical mechanism of GRB X-ray
flares is magnetic reconnection.
