We don't have to reverse the process of creating energy from fuel.
Firstly, we only need to seperate carbon and oxygen.
Secondly, we get thousands of times more energy from the sun than we need.
So even if seperating carbon and oxygen requires energy, that is not fundamentally a problem.