The thermal and chemical evolution of star-forming clouds is studied for different gas metallicities , Z , using the model of Omukai ( 2000 ) , updated to include deuterium chemistry and the effects of cosmic microwave background ( CMB ) radiation . HD-line cooling dominates the thermal balance of clouds when Z \sim 10 ^ { -5 } -10 ^ { -3 } Z _ { \sun } and density \approx 10 ^ { 5 } { cm ^ { -3 } } . Early on , CMB radiation prevents the gas temperature to fall below T _ { CMB } , although this hardly alters the cloud thermal evolution in low-metallicity gas . From the derived temperature evolution , we assess cloud/core fragmentation as a function of metallicity from linear perturbation theory , which requires that the core elongation { \cal E } \equiv ( b - a ) / a > { \cal E } _ { NL } \sim 1 , where a ( b ) is the short ( long ) core axis length . The fragment mass is given by the thermal Jeans mass at { \cal E } = { \cal E } _ { NL } . Given these assumptions and the initial ( gaussian ) distribution of { \cal E } we compute the fragment mass distribution as a function of metallicity . We find that : ( i ) For Z = 0 , all fragments are very massive , \lesssim 10 ^ { 3 } M _ { \sun } , consistently with previous studies ; ( ii ) for Z > 10 ^ { -6 } Z _ { \sun } a few clumps go through an additional high density ( \gtrsim 10 ^ { 10 } { cm ^ { -3 } } ) fragmentation phase driven by dust-cooling , leading to low-mass fragments ; ( iii ) The mass fraction in low-mass fragments is initially very small , but at Z \sim 10 ^ { -5 } Z _ { \sun } it becomes dominant and continues to grow as Z is increased ; ( iv ) as a result of the two fragmentation modes , a bimodal mass distribution emerges in 0.01 < Z / Z _ { \sun } < 0.1 . ( v ) For \gtrsim 0.1 Z _ { \sun } , the two peaks merge into a singly-peaked mass function which might be regarded as the precursor of the ordinary Salpeter-like IMF .