|MadSci Network: Physics|
What you are describing is a perpetual motion machine of the first order, which cannot exist according to the First Law of Thermodynamics. The First Law states that energy, like matter, cannot be created or destroyed, i.e. the amount of energy a system can produce cannot be more than the sum of the internal energy of the system and the energy added to the system. So, unless your system contains an internal source of energy (i.e. chemical or nuclear), the energy output cannot be more than the energy input. Cycling between different forms of energy does not create more energy.
Let's look at the specifics of your system. If the electricity from the alternator is fed directly into the motor, then turning the driveshaft would generate electricity which would turn the driveshaft. Because energy cannot be made from nothing, the driveshaft can only increase its speed if more energy (or work) is added to the system. By the same token, any work done by the driveshaft on something outside the system would remove that much energy from the system causing the driveshaft to slow down. The same applies to adding or removing electrical power from the system: adding more electricity would increase the driveshaft's speed, while removing electricity would slow it down.
In fact, friction on the moving parts and resistance in the electrical wires reduces the efficiency of both components so that some of the energy put into the system is continuously lost to keeping the motor and alternator running. Even more important is the dreaded the Second Law of Thermodynamics. One of the orginal statements of the Second Law (paraphrased from Kelvin and Planck) is that it is impossible to construct a machine that, operating in a cycle, will convert energy into work without loss of energy to the machine or its surroundings. That is to say, each time work from the motor is converted into electricity or electricity from the alternator is converted into work, some energy is lost to entropy making the processes (even if hypothetically frictionless and superconducted) less than 100% efficient.
In the centuries that people have been trying to construct perpetual motion machines, none have been successful. Not because they didn't try hard enough or weren't smart enough, but simply because of the limitations placed on us by the universe regarding the essential nature of energy itself.
Try the links in the MadSci Library for more information on Physics.