We report on a temperature-induced transition from a conventional semiconductor to a two-dimensional topological insulator investigated by means of magnetotransport experiments on HgTe/CdTe quantum well structures. At low temperatures, we are in the regime of the quantum spin Hall effect and observe an ambipolar quantized Hall resistance by tuning the Fermi energy through the bulk band gap. At room temperature, we find electron and hole conduction that can be described by a classical two-carrier model. Above the onset of quantized magnetotransport at low temperature, we observe a pronounced linear magnetoresistance that develops from a classical quadratic low-field magnetoresistance if electrons and holes coexist. Temperature-dependent bulk band structure calculations predict a transition from a conventional semiconductor to a topological insulator in the regime where the linear magnetoresistance occurs.