|The kinetic energy that water gains when it falls (and can therefore be converted into electricity by a hydroelectric plant) comes ultimately from sunlight and not from gravity. As a force, no energy can be extracted from gravity itself. Public Domain Image, source: Christopher S. Baird.|
No, gravity can not be used as an infinite energy source. In fact, strictly speaking, gravity itself can not be used as an energy source at all. You are confusing forces with energy, which are very different things. Energy is a property of objects, such as balls, atoms, light beams, or batteries. In contrast, forces describe the interaction between objects. Forces are the way that energy is transferred from one object to another when they interact, but forces are not the energy itself. Gravity is a force, so it just provides one way for objects to exchange and transform energy to different states.
If I lift a bowling ball to the top of a hill and let it go, the ball falls, speeds up, and seems to gain energy. Isn’t this a case of gravity giving energy to the bowling ball? No. Again, gravity is just a force, so it just describes how objects interact. The energy that the ball displays as a falling motion came from my muscles when I hefted the bowling ball to the top of the hill, and not from gravity. Gravity just provides a way to temporarily store energy in an object. We call the energy that an object gains when you lift it against a force “potential energy”. The energy comes from the lifting agent and not from the force. The force just provides a way to transfer energy from one object (my muscles) to another object (potential energy in the lifted ball). When I let go of the ball, gravity converts the potential energy of the ball to the kinetic energy (motional energy) of the ball. But the ball can never gain more kinetic energy than the total potential energy that I put into it by lifting it.
This concept is true of all forces, and not just gravity. Two magnets attract each other and fly together, speeding up and seeming to gain energy. You may think that the energy has come from the magnetic force. In truth, the energy comes from your hand pulling the two magnets apart against the magnetic force. The magnetic force just provides a way for potential energy to be stored in the magnet (by virtue of you pulling them apart, not just by virtue of them being magnets), and then converted from potential energy to kinetic energy. Any time you push an object to a new location against a force, you are giving it potential energy.
It is true that gravity is “unlimited” in the sense that it never turns off. Earth’s gravity will never go away as long as it has mass. But since this is just a force and not an energy, the never-ending nature of gravity cannot be used to extract infinite energy, or any energy at all, for that matter. Think of gravity loosely like a rubber band. Stretch the rubber band and let go and it snaps back into place. You can therefore store potential energy in a rubber band by stretching it, and this potential energy becomes kinetic energy when you let go. But an unstretched rubber band just sitting there won’t move at all, and can’t create any energy. The energy you see in the rubber band snapping comes from you stretching it and not from the rubber band itself. Neglecting heat losses, the kinetic energy that comes out of the rubber band (how much it snaps) is exactly equal to the potential energy that you put into it using your muscles (how much you stretch it). Lifting an object against gravity is just like stretching the rubber band.
Confusing energy and forces leads to non-sensical ideas such as free energy (perpetual motion) machines. Such machines always fail precisely because forces are not energy, and you can’t extract one single bit of energy from a force itself. For instance, a “free energy” machine could consist of a ball that rolls down a hill and hits a paddle, which turns a wheel. The problem with this machine is that the ball has to be returned to the top of the hill for the process to continue, and the amount of energy you have to put into your machine to put the ball back at the top of the hill equals the energy you get out of your machine from the spinning wheel. Actually, the amount of energy you get out of your machines is always less than the energy you put into it because some of the inputted energy is wasted to heat energy through friction. Free energy proponents devise ever cleverer ways to get the ball back to the top of the hill (or the magnets separated again, or the rubber band stretched again, etc.), hoping that just one more extra gear or wheel will somehow magically create energy out of nothing. But they can never get around the fact that forces are not energy and you can never get more energy out of a system than you put in.
What about hydroelectric plants that extract energy from the falling water in rivers? Don’t they extract energy from gravity for free? No. The water in the river is no different from the ball that you have to haul up the hill. The water got its energy not from gravity but from some external agent that placed it high up in the mountains against gravity, so it could fall down the river bed. The external agent in this case is sunlight. Sunlight warms the ocean, causing the water to evaporate and float into the sky. The energy contained in the photons of sunlight is converted to the potential energy of the water molecules that are lifted high in the sky. These water molecules then rain down to the ground, form rivers, and flow back down to the ocean, converting their potential energy to kinetic energy, heat, and (in a hydroeletric plant) electricity. Ultimately, therefore, hydroelectric plants extract solar energy from water.