It's so frustrating in retrospect: you want to reach back in time, grab Kerensky etc by the lapels and shout "JUST END THE WAR BEFORE IT'S TOO LATE!"
The Entente/Allies were forcing him to stay in the war IIRC.
Kerensky unfortunately was too idealistic for his own good, and his early popularity blinded him to deep discontent later. He could have concluded a separate peace (there was no way the Entente could have 'forced him' to continue, but he was too concerned with maintaining Russia's international prestige and had convinced himself that his personal popularity would make the soldiers willing to fight on.
It's kind of crazy, looking at how the Bolsheviks seized power, at how easy it was for them. From what I read, almost any group of 60 or so armed men could have seized control of the government at that time in November; the Bolsheviks were just the first to take the opportunity.