Evolution of sex-determining mechanisms
The evolution of sex-determining mechanisms, characterized by the evolutionary transition to genetic sex determination or temperature-dependent sex determination from the opposite mechanism, has frequently and readily occurred among multiple taxa across a transitionary continuum. Sex-determining mechanisms include genetic sex determination, where sex is determined by genes on sex chromosomes, and environmental sex determination/temperature-dependent sex determination, where sex is permanently fixed by environmental cues after fertilization. Evolutionary transitions between these mechanisms are frequently driven by sex reversal, a phenomenon where environmental overrides produce organisms with discordant genotypic and phenotypic sex. Evolutionary transitions 
Technological advances in comparative chromosome mapping and molecular cytogenetics have advanced understanding of the many transitions between sex-determining modes. Threshold changes in gene expression for either male- or female-determining factors is enough to change modes of sex determination, as these thresholds are heritable, and more labile sex-determining mechanisms can be advantageous in unpredictable or changing environments. Evolutionary transitions from genetic sex determination to temperature-dependent sex determination are possible as long as there is temperature sensitivity in the genetic system (on the sex chromosomes) and selection occurs on those sensitivity levels. All of these drivers of transitions between sex-determining mechanisms are due to a suggested novel locus changing fitness, which selection then acts upon. Current sex-determining systems must be destabilized in order to drive the evolution of a new system. When evolving from a genetic XX/XY or ZZ/ZW system to a temperature-dependent system, temperature-dependent sex determination naturally avoids nonviable YY or WW genotypes. The evolution of temperature-dependent sex determination is considered to be adaptive in most hypotheses, with a few suggest neutral or quasi-neutral evolution. Originally, these transitions were believed to require the crossing of a fitness valley (a barrier to adaptation that a population must pass through in order to reach an advantageous stage), where the current sex-determining system was ineffective, degenerated, or had reduced viability. However, recent studies have found that these transitions can occur rapidly and easily without crossing a fitness valley, and stable, mixed-mechanism endpoints in sex-determining mechanisms that incorporate both genetic and temperature dependence can occur. Research has suggested sex-determining systems to be a continuum rather than a dichotomy, with placement for a particular system on that continuum being based on the value of the male-determining threshold. Chromosomal inversion is another suggested driver of evolution between mechanisms, as inversions are known to be associated with hybrid incompatibility. Ancestral form 
Phylogenetic analyses have determined that both genetic sex determination and temperature-dependent sex determination have evolved multiple times, with multiple independent origins, and these transitions are not as conserved and linear as once thought. Temperature-dependent sex determination is believed by many to have been the ancestral sex determining mechanism. In turtles, one study suggests that genetic sex determination has originated at least six times: in (1) trionychids, (2) chelids, (3) staurotypids, (4) emydids, and (5 and 6) twice in batagurids. Temperature-dependent sex determination is believed to have evolved at least five times in lizards. Nine-spined sticklebacks (Pungitius pungitius) displayed an ancestral ZW system, but chromosome incompatibility and inversion due to hybrids led to the evolution of their current XY system. The haphazard distribution of both genetic sex determination and temperature-dependent sex determination among reptiles suggests frequent transitions that are likely easy to achieve. The ability for these frequent transitions between diverse sex determining mechanisms is believed to be driven by an even greater diversity of transitional stages. In other vertebrates, genetic sex determination has been found to be the ancestral condition, and there is documentation of temperature-dependent sex determination origin in fishes. Temperature-dependent sex determination is proposed to be an adaptation to particular life histories, allowing embryonic lability according to the surrounding environment. Most current evidence suggests ancestral temperature-dependent sex determination, though ancestral genetic sex determination in reptiles is possible. Some scientists do not recommend ordering sex-determining mechanisms, as gains and losses of either mechanism are equally plausible. In the absence of conclusive information, parsimony is suggested to be the best approach for determining ancestral forms. Sex reversal 
Sex reversal, an environmental override where phenotypic sex is discordant to genotypic sex, is a powerful and rapid driver of transitions between these mechanisms. Sex reversal is heritable and variable, indicating evolution of the threshold can and does occur. This is thought to be a response to reduce extreme sex ratio bias. Rapidly changing environments can lead to unbalanced sex ratios and possible extinction if the threshold is not allowed to evolve over multiple generations. Reptiles have experienced numerous transitions between genetic sex determination and temperature-dependent sex determination, even in closely related species, with sex reversal being a large driver of those transitions. In species with a ZW sex chromosome system, such as central bearded dragons (Pogona vitticeps), sex reversal produces ZZf females. That subsequent loss of the W chromosome in those individuals eventually leads to the loss of the W chromosome in the population, shifting the species towards temperature-dependent sex determination. When exposed to the appropriate temperatures, females no longer need a W chromosome, which allows specific, natural, and wild shifts in sex determining mechanisms. This process can result in skewed sex ratios, but selection for rarer sex tends to occur, with some species and individuals resisting sex reversal despite being at the threshold temperature. Resistance to the process of sex reversal can lead to evolutionary changes in thermal threshold in future populations. This evolution in the threshold, both increases and decreases, is often what promotes transitions between both sex-determining systems. These threshold shifts can also occur due to genetic drift, pleiotropic benefits, sex ratio selection, sexual antagonism, or hitchhiking genes. Sex-reversed female bearded dragons can lay twice as many eggs per year as genetic ZW females, suggesting an immediate fitness advantage to sex reversal that could be another driver of evolutionary transitions. Evolutionary transitions from ZZ/ZW to temperature-dependent sex determination involve an increase in the thermal threshold, which results in sex reversal of genetic males and ultimately the loss of the W allele, which prevents the nonviable WW combination from occurring. Transitioning from XX/XY to temperature-dependent sex determination requires lowering of the threshold. Only XX embryos can be sex-reversed, resulting in the loss of the Y allele and preventing the nonviable YY combination. Transitions move rapidly through intermediate states, and research has shown that evolutionary transitions from genetic sex determination to temperature-dependent sex determination should be simple under the right selection pressures and varied temperatures. However, most transitions from genetic sex determination to temperature-dependent sex determination occur rapidly through intermediate forms rather that persisting in those states, with the discrete separations representing the stable states of sex determining mechanisms. Sex reversal, in particular, is considered to be a common transitional step along this continuum. References 

Wikipedia Student Program
Sex-determination systems
Evolutionary biology