  The aim of this paper is to identify and study the properties and galactic
content of groups and clusters in the GOODS-South field up to z\sim2.5, and to
analyse the physical properties of galaxies as a continuous function of
environmental density up to high redshift. We use the deep (z850\sim26),
multi-wavelength GOODS-MUSIC catalogue, which has a 15% of spectroscopic
redshifts and accurate photometric redshifts for the remaining fraction. On
these data, we apply a (2+1)D algorithm, previously developed by our group,
that provides an adaptive estimate of the 3D density field. We support our
analysis with simulations to evaluate the purity and the completeness of the
cluster catalogue produced by our algorithm. We find several high density peaks
embedded in larger structures in the redshift range 0.4-2.5. From the analysis
of their physical properties (mass profile, M200, \sigmav, LX, U-B vs. B
diagram), we derive that most of them are groups of galaxies, while two are
poor clusters with masses of few times 10^14 Mo. For these two clusters we
find, from the Chandra 2Ms data, an X-ray emission significantly lower than
expected from their optical properties, suggesting that the two clusters are
either not virialised or gas poor. We also analyse the dependance on
environment of galaxy colours, luminosities, stellar masses, ages and star
formations. We find that galaxies in high density regions are, on average, more
luminous and massive than field galaxies up to z\sim 2. The fraction of red
galaxies increases with luminosity and with density up to z\sim 1.2. At higher
z this dependance on density disappears. The variation of galaxy properties as
a function of redshift and density suggests that a significant change occurs at
z\sim 1.5-2. (abridged)
