We report on the temperature-dependent magnetospectroscopy of two HgTe/CdHgTe quantum wells below and above the critical well thickness dc. Our results, obtained in magnetic fields up to 16 T and s temperature range from 2 to 150 K, clearly indicate a change in the band-gap energy with temperature. A quantum well wider than dc evidences a temperature-driven transition from topological insulator to semiconductor phases. At a critical temperature of 90 K, the merging of inter- and intraband transitions in weak magnetic fields clearly specifies the formation of a gapless state, revealing the appearance of single-valley massless Dirac fermions with a velocity of 5.6×105ms-1. For both quantum wells, the energies extracted from the experimental data are in good agreement with calculations on the basis of the eight-band Kane Hamiltonian with temperature-dependent parameters.