The amount of metals present in the Universe and its cosmological evolution is a key issue for our understanding of how star formation proceeds from the collapse of the first objects to the formation of present day galaxies. We discuss here recent results at the two extremes of the density scale.1. Part of the tenuous intergalactic medium (IGM) revealed by neutral hydrogen absorptions in the spectra of remote quasars (the so-called Lyman-α forest) contains metals. This is not surprising as there is a close interplay between the formation of galaxies and the evolution of the IGM. The IGM acts as the baryonic reservoir from which galaxies form, while star formation in the forming galaxies strongly influences the IGM by enrichment with metals and the emission of ionizing radiation. The spatial distribution of metals in the IGM is largely unknown however. The possibility remains that metals are associated with the filaments and sheets of the dark matter spatial distribution where stars are expected to form, whereas the space delineated by these features remains unpolluted.2. Damped Lyman-α (DLA) systems observed in the spectra of high-redshift quasars are considered as the progenitors of present-day galaxies. Indeed, the large neutral hydrogen column densities observed and the presence of metals imply that the gas is somehow closely associated with regions of star formation. The nature of the absorbing objects is unclear however. It is probable that very different objects contribute to this population of absorption systems. Here we concentrate on summarizing the properties of the gas: presence of dust in small amount; nucleosynthesis signature and lack of H2 molecules. The presence of H2 molecules has been investigated in the course of a mini-survey with UVES at the VLT. The upper limits on the molecular fraction,f = 2N(H2)/(2N(H2)+N(HI)),derived in eight systems are in the range 1.2 ×10-7 - 1.6 × 10-5. There is no evidence in this sample for any correlation between H2 abundance and relative heavy element depletion into dust grains. The molecular abundance in a few DLA systems (and in particular in the two systems where H2 is detected) is consistent with what is seen in the Magellanic clouds, but most of the DLA measurements are well below these values. This is probably partly due to small amounts of dust and/or high UV flux. We argue however that the lack of molecules is a direct consequence of high kinetic temperature (T > 3000 K) implying a low formation rate of H2 onto dust grains. The conclusion is that most of the DLA systems arise in warm and diffuse neutral gas.