Photosynthesis is the process in which carbon dioxide and water are used, along with sun's light energy, to generate glucose and oxygen. Chemically this process can be represented as:
`6 CO_2 + 6 H_2O + light -> C_6H_12O_6 + 6 O_2`
Cellular respiration is a complementary process in which food (glucose) is broken down in the presence of oxygen and carbon dioxide and water are generated, along with the energy (in the form of ATP molecules). Chemically, cellular respiration is represented as:
`C_6H_12O_6 + 6 O_2 -> 6 CO_2 + 6 H_2O + ATP`
In both the reactions, gases are consumed and gases are produced. By measuring or detecting the generation of gases we can confirm if photosynthesis and cellular respiration are taking place. For example, we can measure the amount of oxygen that is being generated and verify the occurrence of photosynthesis. Similarly, generation of carbon dioxide is a proof of occurrence of cellular respiration.
Also, we can measure the rates of generation of these gases throughout the day and night and by changes in the rates, can show that these processes are taking place. Remember, photosynthesis only takes place during day, while respiration is continuous. So, rate of oxygen production would drop during night and CO2 generation will increase.
Hope this helps.