During an isothermal reversible expansion of a gas, all heat absorbed by the gas from the reserviour is being used up to push the piston up. But doesn't this contradict something like the second law? When I push a brick on a rough table, the motion will eventually stop and some heat will be generated due to friction, but If I get a bunsen burner and supply the same amount of heat, it brick won't move back to where it started.
In an isothermal reversible process the total entropy change of piston and energy reservoirs (surroundings) must be zero, $\Delta S_T = 0$. Thus the entropy of the expanding gas may increase but only if it is compensated for by a decrease in entropy of the reservoirs. So no contradiction of second law. (The heat absorbed from the surroundings is $T\Delta S $ and if this is positive more work can be done by a chemical reaction than the heat of reaction.)
In the second question you will realise that you can turn all the work into heat but not all the heat into work. Its entropy again.