Some things I don't understand:

If oxygen accepts electrons from the electron transport chain, how does it become a molecule of water? ie where does the hydrogen come from?

In chemiosmosis, protons are pumped against their concentration gradient across the inner mitochondrial membrane to create a pH gradient which then powers ATP synthesis. But doesn't the initial pumping out of protons use ATP?

The hydrogen ions are pumped into the intermembrane space from the mitochondrial matrix. Oxygen captures the electrons in the very last step in the electron transport and adding electrons to that oxygen atom and two hydrogen ions form water.

No. ATP synthase transports hydrogen ions and it's powered by the flow of hydrogen ions back across the membrane. Those backed-up hydrogen ions will give up their energy when they diffuse through a special protein in the membrane (ATP synthase). That pH gradient will power the pumping - not ATP.

To understand how oxygen becomes a molecule of water and where the hydrogen comes from, we need to look at the process of cellular respiration in more detail.

During cellular respiration, the electron transport chain (ETC) is responsible for the transfer of electrons from one molecule to another. In the final step of the ETC, oxygen acts as the final electron acceptor. This occurs in the mitochondria, specifically on the inner mitochondrial membrane.

When oxygen accepts electrons from the ETC, it combines with hydrogen ions (protons) to form water. These protons are provided by the splitting of oxygen during an earlier process called glycolysis and the citric acid cycle. As glucose is broken down in these steps, electrons and protons are released and carried by electron carriers such as NADH and FADH2 to the ETC.

In the ETC, the electrons are passed along a series of proteins embedded in the inner mitochondrial membrane. As the electrons move through this chain, they release energy, which pumps protons from the inner mitochondrial matrix to the intermembrane space. This creates a higher concentration of protons in the intermembrane space compared to the matrix, establishing an electrochemical gradient.

Next, these protons move back into the matrix through a protein channel called ATP synthase. As they do so, their flow drives the synthesis of ATP, which is the energy currency of the cell. This process is known as chemiosmosis.

Now, let's address the second question about whether the initial pumping out of protons requires ATP. The energy required to pump protons against their concentration gradient comes from the initial steps of cellular respiration, namely glycolysis and the citric acid cycle. These steps generate ATP and electron carriers (NADH and FADH2) that are used in the electron transport chain. The energy released during electron transfer along the chain is used to pump protons, creating the electrochemical gradient that powers ATP synthesis. So, while ATP is consumed in the earlier steps of cellular respiration, it is not directly used for proton pumping in chemiosmosis.

I hope this explanation helps clarify your understanding of these processes.