We know from General Relativity that light needs to expend some energy to overcome the gravitational pull of massive objects. This is done by decreasing it's frequency and so it's colour shifts towards red. But what I don't understand is that where does this energy go? According to law of conservation of energy, the total energy in the universe must be constant. But this is not in the case of gravitational red shift. We can't add it to the gravitational potential energy because as Einstein said gravity is not a force but simply a curvature in space time.
The total energy of things in the universe is only conserved when the laws of nature they experience are time independent. Because the universe expands, this is not the case. It's like what happens to the energy of pendulum when you slowly shorten the string. The sum of kinetic an potential energy of the pendulum is not conserved under this process.
We know from General Relativity that light needs to expend some energy to move into the upwards direction. This is done by decreasing its frequency and so its colour shifts towards red. According to law of conservation of energy, the total energy in a closed system must be constant. This is true in the case of gravitational red shift too. The energy goes from the light to somewhere. If the light gets reflected back, energy starts going from the aforementioned 'somewhere' to the light.
What is the aforementioned 'somewhere'? It is the surrounding matter and the surrounding space-time.