Lets take the case of a person doing heavy exercise. Aerobic respiration is taking place, but oxygen is about to be finished up. Glycolysis occurs, Krebs cycle finishes. Now NADH and FADH2 enter electron transport system (ETS) to form ATP, but at the last step, cytochrome c oxidase cannot get oxygen as it just finished up. Now, what happens to the ongoing ETS? Does it go in reverse order and then arnon cycle to get back Acetyl co-A and respire anaerobically, or does this process get paused and respiration switches over to anaerobic mode till oxygen supply is replenished?
The simple answer to your question is that in the absence of oxygen the electron transport chain stops. (It can't go backwards, that would generate oxygen.) However your assumption that it stops at the last step is incorrect, all the cytochromes are converted to their reduced form, and there is feedback that diverts the NADH elsewhere.
The situation is complicated because it depends what tissue you are talking about and what sort of exercise and what is the fuel for respiration. However let us consider the skeletal muscle at the start of a non-sprint run. Let us assume that it will be using glycogen as a source of fuel, which is converted to pyruvate and NADH. The pyruvate will enter the tricarboxylic acid (TCA) cycle in the mitochondria and be oxidized there and also produce metabolites. The NADH from glycolysis (produced by reducing NAD+) will enter the mitochondria and be oxidized; however it does not enter directly but via a shuttle, one of which — the malate-aspartate shuttle, show below — will be considered in a more detail lower down.
Now let us suppose there is a sudden need to sprint so that the muscle cannot get sufficient oxygen to deal with the NADH produced in glycolysis. What happens? The key event is that pyruvate is oxidized to lactate. Why? Not because lactate is useful, but because this is an anaerobic means of oxidizing the NADH back to NAD+ to allow glycolysis to continue and ATP to be produced at the substrate level.
Why doesn't the NADH keep going into the mitochondria (where it would be wasted as the electron transport chain has stopped)? Because the shuttle stops — in the case of the malate-aspartate shuttle mitochondrial malate dehydrogenase stops converting malate to oxaloacetate, malate builds up and therefore the malate transporter stops bringing malate into the mitochondrion.
This can be understood at the most general level by the fact that if NADH in the mitochondrion cannot be oxidized it will accumulate, hence slowing and eventually arresting the malate dehydrogenase reaction by simple mass action.
In fact Nature generally uses more sophisticated regulation that allows switch on and switch off to be performed more rapidly and completely, most notably by allosteric regulators. In the case of malate dehydrogenase the situation is not really clear, but there are reports that suggests citrate is an allosteric activator of the enzyme in some tissues (http://www.ncbi.nlm.nih.gov/pmc/articles/PMC1131027/). The concentration of citrate falls as the TCA cycle stops because of the lack of NAD+ (this is because TCA cycle intermediates get tapped off for other purposes) so the activating effect of this intermediate would be removed.
(There is another shuttle for reducing power that my be more important in skeletal muscle. This is the glycerol 3-phosphate shuttle. However as this requires the oxidized form of FAD directly in the mitochondrial membrane it will clearly shut down in anoxia.)
The net result is that the NADH stays in the cytosol to be oxidized by pyruvate in the lactate dehydrogenase reaction.
This can only happen if the pyruvate stays in the cytoplasm and does not move to the mitochondrion. Obviously the lack of NADH to reduce it to acetyl-CoA in the pyruvate dehydrogenase reaction would cause its concentration to build up in the mitochondrion and reduce transport across the membrane by simple mass action. However it is likely that the specific mitochondrial pyruvate transporter is regulated by metabolites which change their concentration under these conditions. The evidence here is indirect as the transporter was only identified and cloned in 2012.
Nice question. Now a perfect answer should include all the regulatory steps involved in this transition (a lot) and all the places where a change of metabolic fluxes occur. But, the question can be answered in essence at least, by a very simple model.
Assume that no other regulations act except direct enzymatic feedback inhibition. This means that substrate being acted upon by an enzyme converting it to a product will stop being acted upon when the concentration of the product rises. Now, for the case in question. Lack of oxygen means that cytochrome c cannot work. Hence, it's substrate will accumulate, which is the product of the preceding enzyme, which will be blocked leading to the accumulation of its substrate and so on. This "waterlogged" system will continue leading to metabolite accumulation till pyruvate starts piling up. Now this pyruvate piling does something different because it had two enzymes that could act upon it. The other enzyme, which converts it to lactate does not have this feedback blockage and hence can function. So, the pyruvate is now converted into lactate, which requires NADH, and hence allows glycolysis to proceed (because the formation of NADH was an indispensable reaction in glycolysis), and hence, you have the anaerobic shift. Lactate doesn't pile as it has a favourable muscle-blood gradient and is quickly transported out the cell, and also because it has to pile up significantly before the enzyme forming it is back-logged.
Now, to add the other regulations. What all other regulatory factors do, is to enhance this waterlogged feedback. Instead of the product piling up to a huge amount before the enzyme is inhibited, these regulations will allow a smaller pile-up to produce the feedback inhibition. So in essence, you can view the shift as a simple consequence of blocking the enzymatic chain at a particular level.
I think both @David and @SatwikPasani have given nice answers, but none of them seems complete and involving all details. So I am posting another answer which involves much of the required details for benefit of readers as well as myself.
The simplest answer would be that cell switches from aerobic to anaerobic respiration via allosteric inhibition of enzymes from product build-up. The details, in a stepwise manner, go as follows:
In the absence of oxygen, mitochondria activate a factor known as hypoxia-inducible factor-1 (HIF-1)1. HIF-1 helps in slowly shutting down the electron transport chain. This happens as HIF-1 induces subunit switching from cytochrome-c oxidase subunit 4 isoform 1 (COX4-1) to COX4-22. Also, HIF-1 induces activation of micro-RNA 210 (mir-210)3, which blocks expression of iron-sulfur cluster assembly proteins ISCU1/24, which are required for the function of complex I5, COX106, aconitase and subunit D of succinate dehydrogenase. Apart from this, in decreased levels of O2, nitric oxide (NO) causes inhibition of respiration and even cell death7. Also, nitric oxide synthase is a target of HIF-18. You can understand this by this diagram9:
Now, shutting down electron transport chain causes accumulation of NADH (and FADH2) in the mitochondrion. This build up, in turn, shuts another process known as malate-aspartate shuttle (MA shuttle), which is essentially a process to indirectly transfer NADH from cytosol to mitochondrion since mitochondrial membrane is impermeable to NADH10. Now, since malate-aspartate shuttle is not working anymore, thus NADH remains in the cytosol. See this through the diagram below:
Another point is that accumulation of NADH in the mitochondrion shuts down krebs cycle. It is so because two of the main enzymes, isocitrate dehydrogenase and $\alpha$-ketoglutarate dehydrogenase, both of which require the presence of NAD+ to function, are inhibited by the presence of NADH11. Also, aconitase and succinate dehydrogenase are inhibited by mir-210 as already discussed. Thus, inhibition of krebs cycle occurs, which leads to accumulation of acetyl-coA. See the diagram below:
Now, accumulation of both NADH and acetyl-coA inhibit the activity of pyruvate dehydrogenase12, which leads to accumulation of pyruvic acid in the mitochondrion. This is also clear from the above diagram.
Now, since pyruvic acid is not being metabolized, it is hence no more transported from cytosol to mitochondrion. Transportation of pyruvic acid from cytosol (after glycolysis) to mitochondrion (for krebs cycle) requires mitochondrial pyruvate carrier (MPC). Now, presence of malate is shown to promote the activity of MPC13. But since krebs cycle has already stopped, so no more malate is being produced. Also, since malate is not metabolized through MA shuttle (see second point), so it travels back into the cytoplasm (or is not produced at all). Thus, activity of MPC is significantly reduced. Apart from this, $\alpha$-keto acids are known to inhibit the activity of MPC14. Thus, due to accumulation of $\alpha$-ketoglutarate (which is not metabolized by $\alpha$-ketoglutarate dehydrogenase, see third point), activity of MPC is further reduced. Because of these effects, pyruvate remains in the cytosol. See the following diagram for clarification15:
In the last step, accumulation of pyruvic acid as well as of NADH in the cytosol together promote anaerobic respiration since in this process, NADH is converted to NAD+, which is possible due to the presence of NADH. This is also helpful since it not only helps in decreasing the accumulation of cytosolic NADH, but also in metabolizing the NADH generated from glycolysis. Finally, the complete process can be visualized by the following diagram:
P.S.: However, accumulation of lactate does not happen (i.e. a question like What if excess lactate inhibits anaerobic respiration? would not make sense) because lactate is readily removed from the cytosol to outside the cell so that it is transported to the liver, where it is converted back into glucose. This process is known as Cori Cycle16. See this diagram:
Bonus: A novel research has concluded that extracellular acidosis (induced by release of lactic acid), causes a dramatic increase in efficiency of ATP production by mitochondria during hypoxia(!). Under neutral hypoxia (without acidosis), mitochondria get fragmented and lead to impaired ATP production, causing cell death. But under acidosis-hypoxia, mitochondria become unusually elongated (by inhibiting DRP1-mediated mitochondrial fission17 and inducing mitochondrial fusion via Stress-Induced Mitochondrial Hyperfusion (SIMH) pathway18), cristae get remodelled through OPA119 which protects and maintains ATP production in the cell in hypoxia. See this diagram:
Since the whole process is reversible (by bringing extracellular pH to neutral), thus a dynamic equilibrium can be attained in cells with high oxygen demand, like neurons, through which cell can maintain high ATP production even in hypoxia.
1. Giancarlo Solaini, Alessandra Baracca, Giorgio Lenaz, Gianluca Sgarbi, Hypoxia and mitochondrial oxidative metabolism, Biochimica et Biophysica Acta (BBA) - Bioenergetics, Volume 1797, Issues 6–7, June–July 2010, Pages 1171-1177, ISSN 0005-2728, http://doi.org/10.1016/j.bbabio.2010.02.011.
3. Huang X, Ding L, Bennewith KL, Tong RT, Welford SM, Ang KK, Story M, Le QT, Giaccia AJ. Hypoxia-inducible mir-210 regulates normoxic gene expression involved in tumor initiation. Mol Cell 35: 856–867, 2009
4. Chan SY, Zhang YY, Hemann C, Mahoney CE, Zweier JL, Loscalzo J. MicroRNA-210 controls mitochondrial metabolism during hypoxia by repressing the iron-sulfur cluster assembly proteins ISCU1/2. Cell Metab 10: 273–284, 2009
5. Puissegur MP, Mazure NM, Bertero T, Pradelli L, Grosso S, Robbe-Sermesant K, Maurin T, Lebrigand K, Cardinaud B, Hofman V, Fourre S, Magnone V, Ricci JE, Pouyssegur J, Gounon P, Hofman P, Barbry P, Mari B. miR-210 is overexpressed in late stages of lung cancer and mediates mitochondrial alterations associated with modulation of HIF-1 activity. Cell Death Differ. 2010. October 1
13. Mowbray A. Evidence for the role of a specific monocarboxylate transporter in the control of pyruvate oxidation by rat liver mitochondria. FEBS Lett. 1974;44:344–347. doi: 10.1016/0014-5793(74)81174-9
14. Halestrap AP, Brand MD, Denton RM. Inhibition of mitochondrial pyruvate transport by phenylpyruvate and alpha-ketoisocaproate. Biochim Biophys Acta. 1974;367:102–108. doi: 10.1016/0005-2736(74)90140-0.