We have investigated InGaAs layers grown by molecular-beam epitaxy on GaAs(001) by transmission electron microscopy (TEM) and photoluminescence spectroscopy. InGaAs layers with In-concentrations of 16, 25 and 28 % and respective thicknesses of 20, 22 and 23 monolayers were deposited at 535 C. The parameters were chosen to grow layers slightly above and below the transition between the two- and three-dimensional growth mode. In-concentration profiles were obtained from high-resolution TEM images by composition evaluation by lattice fringe analysis. The measured profiles can be well described applying the segregation model of Muraki et al. [Appl. Phys. Lett. 61 (1992) 557]. Calculated photoluminescence peak positions on the basis of the measured concentration profiles are in good agreement with the experimental ones. Evaluating experimental In-concentration profiles it is found that the transition from the two-dimensional to the three-dimensional growth mode occurs if the indium content in the In-floating layer exceeds 1.1+/-0.2 monolayers. The measured exponential decrease of the In-concentration within the cap layer on top of the islands reveals that the In-floating layer is not consumed during island formation. The segregation efficiency above the islands is increased compared to the quantum wells which is explained tentatively by strain-dependent lattice-site selection of In. In addition, In0.25Ga0.75As quantum wells were grown at different temperatures between 500 oC and 550 oC. The evaluation of concentration profiles shows that the segregation efficiency increases from R=0.65 to R=0.83.