Germany pretty much did fight for as long as it could in 1918. Although the German Army tried to pretend this wasn't the case (and here is the origin of the stab-in-the-back myth), Germany had nothing left to give and its army was crippled.
By the end of the war, the German people were on the brink of starvation due to a combination of Allied blockade and massive mismanagement of the economy. Their empire in the east was collapsing. The completely pointless attacks in the west (even before the Americans arrived, the Allies outnumbered the Germans in the west heavily) had been defeated not by fifth-columnists but by the Allied armies.
Germany was either going to surrender in 1918 or it was going to collapse into civil war in 1919, with the Allies supporting one side or the other. In effect, the Germans had already fought to the bitter end.