Without hope there is only hope.
I think Frodo had to come to that point where he knew he wasn't going to return but that finishing his mission was all he had to do. He always knew he was on a mission to save The Shire and Middle Earth but I don't think he fully realised exactly what that meant until well into the journey and he saw what they were all up against. His sheltered Shire existence was destroyed and he came to know what evil truly was. He also knew love, hope, friendship and duty even though that would be the death of him.
Once inside Mordor, with the amount of evil and the Eye of Sauron, I think he lost all
hope, even hope of destroying the ring. But in losing that hope, he lost everything and having nothing to lose all he could do was carry on. This didn't bring hope to Frodo but hope was there, hope that in his desperation he would still destroy the ring.
There were little things that happened which I think kept the spark alive, in particular from the
RotK - The Land of Shadow
"Look at it, Mr Frodo!' said Sam. 'Look at it! The wind's changed. Something's happening. He's not having it all his own way. His darkness is breaking up out in the world there. I wish I could see what is going on!'
As it went it sent out a long shrill cry, the coice of a Nazgul; but this cry no longer held any terror for them: it was a cry of woe and dismay, ill tiding for the Dark Tower. The Lord of the Ringwraiths had met his doom.
There, peeping among the cloud-wrack above a dark tor high up in the mountains, Sam saw a white star twinkle for a while. The beauty of it smote his heart, as he looked up out of the forsaken land, and hope returned to him. For like a shaft, clear and cold, the thought pierced him that in the end the Shadow was only a small and passing thing; there was light and high beauty for ever beyond its reach
I think Frodo's biggest hope was Sam, who had worn the ring and resisted it knowing that 'one small garden of a free gardener was all his need and due....'