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