Up to the Battle of Cannae, Hannibal was decisively winning the war. The Romans did win at the end, but it baffles me that the Romans didn't see Cannae as a significant loss to even bother negotiating peace.
I am interested in an explanation of why Rome believed they were still "in the war" - that is, not utterly defeated.
On a more general level, are there other empires, kingdoms, nations or states historically known for a ridiculous stubbornness regarding losing wars?
And on a more abstract level, how do such civilizations come into being as opposed to other "weaker" ones? What are the conditions or developments that result in such a strong belief in one's invincibility?
Because they knew that Hannibal was incapable of taking Rome with its strong fortifications, intact population and 2 legions remaining in the city. Staying in one place to besiege the city for many months would have meant, that the supplies would have to be delivered to the besieging army, which was hard since the sea was still controlled by the Roman navy. Hannibal's army had to constantly be on the move for foraging to have enough supplies, which would be impossible if he was gonna besiege a city for as long as it would have taken in the case of the well supplied Roman capital. Hannibal knew that and so he chose a different strategy.
edit: So, to summarize for your second question. The war was far from lost, even after Cannae, although there sure were heated debates in the Senate just how bad the situation really was and it took the Romans some time to count there losses and realize that it wasn't over.
The Romans didn't surrender at Cannae because Cannae was not the first time in their history, nor in the 2nd Punic War, that they had suffered a massive defeat. Yes, it was the most massive, and briefly sent Rome into a panic, but it was not the only major defeat -- and they knew clearly why it had happened, and what they had to do to defeat Hannibal in the long run. How did they know this? Because they had already suffered massive defeats at Hannibal's hands in the Battles of Trebia and Lake Trasimene, and figured out how to come back.
Prelude
Lake Trasimene remains the largest ambush ever perpetrated in military history, and was a massive defeat for the Romans. Following it, there was unrest in Rome, and Quintus Fabius Maximus, later given the cognomen (at the time, it was used as an epithet) "Cuncator" for his delaying tactics, was elected dictator. Fabius was a strategic genius, and quickly saw that the strategic situation -- as well as Hannibal's talent -- were beyond the means of Rome to deal with head-on, despite what the Senate and the populace traditionally would have preferred. He reasoned, correctly, that Hannibal's weakness was not in his army, but in his supply, so the best way to deal with him was to gradually weaken him by raiding his supply lines, and never offering him a pitched battle. Essentially, Fabius invented the modern practice of guerrilla warfare, using fast, mobile units to attack Hannibal's supply lines, harry and weaken him, and generally give him a frustrating runaround. This form of strategy is still called the "Fabian" strategy, after Fabius.
This proved to work very well, and Rome gradually grew stronger, while Hannibal, saddled with an inept Carthaginian Senate and no ability to decisively destroy Fabius, ended up chasing him around the peninsula. The problem was that this strategy was unpopular, and that Fabius did not have unity in his chain of command. His cavalry general, an man called Menucius, was an ambitious political opponent of Fabius, which led to all sorts of mischief -- Menucius disobeyed direct orders and frontally attacked Hannibal on two occasions, both times getting his ass handed to him.
But, Romans deeply believed they were strong enough to take on any opponent, and that their defeats had been because they had displeased the gods. Fabius himself believed this, and gave huge donations to the various temples while conducting his campaign -- which seemed to do the trick, of course. So, when Fabius' dictatorship ended, he was replaced with two more belligerent consuls, who, figuring the gods were now good to go, abandoned his strategy and attacked Hannibal head on in what would be the Battle of Cannae. We all know what happened there.
Immediate Aftermath and Situation
Now, the Romans were, indeed panicked after the battle. They didn't know exactly what to do, and a military tribune, Metellus, actually propagated the idea that all was lost and that the other tribunes and himself should join forces and sail to some far off shore to be commanders for some unknown king somewhere. At this point, Hannibal had defeated 16 legions, with all their allies, and Rome had lost about 20% of its population of military-aged males. Roman allied city-states and minor states revoked their alliances and sided with Hannibal instead. Philip V of Macedon declared war against Rome (initiating the First Macedonian War), and pledged to support Hannibal any way he could.
Shit was bad, yo.
Recovery and Refusal
BUT: the Romans absolutely refused to surrender. Hannibal actually sent ministers to negotiate moderately favorable surrender terms, but the Roman Senate categorically refused to receive them. They declared a total population mobilization for military-aged men, and this time included landless peasants and even male slaves. They even banned the word "pax" (peace) from being uttered in the Senate for a time.
The reason the Romans did this is because they understood that Hannibal did not have the resources to besiege the city (which would have required a subdual of the entire countryside around it), and a secure supply line for himself. They also knew that they had a strategy that would work, that did work, that could work -- if they just stuck to it. And that's exactly what they did. For the remainder of the Second Punic War, the Romans reverted to the Fabian strategy for the most part, and essentially waited for Hannibal's morale to break.
With no way to force a decisive battle, and no way to destroy the heart of Rome itself, Hannibal was put in an untenable position, and effectively his defeat became inevitable. The Romans knew this, and they finally were willing to be guided by knowledge rather than pride.
Sources:
Hanson, Victor Davis | Carnage and Culture: Landmark Battles in the Rise to Western Power
King, Charles R. | The Cuncator: How Fabius Maximus Saved Rome
Plutarch | Lives of the Noble Greeks and Romans, Vol. III