I think the answer to the question is really both. Humanity is not left in a good place, yet the human spirit is shown to be resilient, patient, and compassionate.
The ending of this book is not really its greatest strength, however, so I lean a bit toward a pessimism myself.
This quote sums up my view, I believe, of the pessimistic view of society and the optimistic view of man's ability to find some spiritual redemption.
You're not like the others. I've seen a few; I know. When I talk, you look at me. When I said something about the moon, you looked at the moon, last night. The others would never do that. The others would walk off and leave me talking. Or threaten me. No one has time any more for anyone else. You're one of the few who put up with me. That's why I think it's so strange you're a fireman, it just doesn't seem right for you, somehow.
I'd say here that not only is Montag wrong for the fire department, he is wrong for the world he lives in.
I would most definitely say that the story ends on a positive note. All has not been lost. Well, Montag is a murderer, he realizes his marriage was a sham, and the city has been demolished. But Montag has come through the fire (almost literally) to be united with other people who want to read and remember what they read and preserve books. Montag is living in the real world, having accomplished what Clarisse had alluded to at the story's beginning.
The image of the phoenix that is introduced by Granger (the man Montag meets after he travels down the river) delivers this image of hope to Montag:
There was a silly damn bird called a phoenix back before Christ, every few hundred years he built a pyre and burnt himself up. He must have been a first cousin to Man. But ever time he burnt himself up he sprang out of the ashes, he got himself born all over again. And it looks like we're doing the same thing, over and over, but we've got one damn thing the phoenix never had. We know the damn silly thing we just did...and as long as we know that...someday we'll stop making the goddamn funeral pyres and jumping in the middle of them.
The phoenix is a symbol of rebirth, of hope. Montag is part of a group of people who want to rebuild and avoid making the same mistakes in the future. They are moving forward. I think this is a positive ending to the story.
This novel ends on an optimistically pessimistic note. Pessimism is rank because all is destroyed:
"City looks like a heap of baking-powder. It's gone." And a long time after that. "I wonder how many knew it was coming? I wonder how many were surprised?"
And across the world, thought Montag, how many other cities are dead? And here in our country, how many? A hundred, a thousand?
However, some few are survivors. Some few may find the courage to start again and build something from the ashes through hard work and dedication. This is the optimism that tries to stand in the midst of the sorrow and ashes:
after a while added tiny twigs which were wet and sputtered but finally caught, the fire grew larger in the early morning as the sun came up ....
I, too, think that the ending of the story is optimistic. After all, the city has been destroyed, symbolizing the destruction of the society that Montag hates so much. Montag and others like him are still alive. This suggests that the world can (at least possibly) be remade in a better way.
For a quote, I'd use the one that ends the book, where Montag is thinking about the Bible verse about the tree that is "for the healing of the nations."
I think that the ending to Bradbury's work is simply that: An ending. One can pull the optimism or pessimism out of it as one sees fit. A compelling case can be made for either reads and perhaps it is here where Bradbury's greatness is most evident. On one hand, Montag is out. He escapes. In joining the "book covers," there is hope for humanity. Montag remembers Ecclesiastes, something that had been eluding him for some time. I think that the fact that Montag is able to stand for the trend that is fundamentally and inherently superior to his previous life as a fireman represents an aspect of hope in the novel. At the same time, I think that Montag and the book covers are the minorities. Indeed, while they might be called upon as the ravages of the war destroy society, they are still the minority and on the periphery of society. One has to figure that the same forces that sought to marginalize them in the first place will not relinquish power so easily, and in their potential resurrection or claiming of power, there is a quite realistic avenue that the pursuits of the "book covers" will have to be again continued underground, reflecting a lack of real change. I think that it is dependent on how the reader approaches the issues raised in the novel and how the reader appropriates from the most fundamental point of view the notion of social change and transformation.
If I were to choose one or the other I would say that the ending is more optomistic. At the end the group of men are walking toward the city to try and start a fresh, new beginning, hoping that it will be much better than the last time. They are trying to learn from their mistakes from past generations to build a strong foundation for future generations. The way the book ends, Ray is leaving a shade of hope and maybe adventure for the group to disclose.