  We trace the evolution of central galaxies in three ~10^13 M_sun galaxy
groups simulated at high resolution in cosmological hydrodynamical simulations.
The evolution in the group potential leads, at z=0, to central galaxies that
are massive, gas-poor early-type systems supported by stellar velocity
dispersion resembling either elliptical or S0 galaxies. Their z~2-2.5 main
progenitors are massive M* ~ 3-10 x 10^10 M_sun, star forming (20-60 M_sun/yr)
galaxies which host substantial reservoirs of cold gas (~5 x 10^9 M_sun) in
extended gas disks. Our simulations thus show that star forming galaxies
observed at z~2 are likely the main progenitors of central galaxies in galaxy
groups at z=0. Their central stellar densities stay approximately constant from
z~1.5 down to z=0. Instead, the galaxies grow inside-out, by acquiring a
stellar envelope outside the innermost ~2 kpc. Consequently the density within
the effective radius decreases by up to two orders of magnitude. Both major and
minor mergers contribute to most of the mass accreted outside the effective
radius and thus drive the evolution of the half-mass radii. In one of the three
simulated groups the short central cooling time leads to a dramatic
rejuvenation of the central group galaxy at z<1, affecting its morphology,
kinematics and colors. This episode is eventually terminated by a group-group
merger. Our simulations demonstrate that, in galaxy groups, the interplay
between halo mass assembly, galaxy merging and gas accretion has a substantial
influence on the star formation histories and z=0 morphologies of central
galaxies.[Abridged]
