Narrative in fiction dictate a beginning, middle and end. Reality doesn't necesarily play by that formula - have plants ended yet? Have earth ended yet? Sure, nothing lasts forever - but there is nothing that dictates that humanity
must be crawling towards a narratively satisfying epic end, worthy of story-telling.
Personally, I think humanity is like a very resiliant mold. Look at our absolutely most disastrous war - the second world war - it did not even dent population growth on earth, we keep on growing exponentially. Throw all the diseases of this planet at us - the earth is not holding back - and we are still growing exponentially.
Give us starvation, give us heat and cold - and so far we grow exponentially.
Now, logic dictates that at some point, we will simply consume every last piece of energy on earth, but how many would we really have to be to get to that point? 100 billion? A trillion? 100 trillion? A fuckin quadrillion?
Okay, those numbers are way bigger than they seem, my point is -
imagine if 2015 is still only the infancy of our species. In the fossil record, certain species of vertebrate can span over several million years - not MANY millions, but say 3-5 million. H. sapiens has so far only existed for a quarter of one - and on top of that, we have almost blocked nature's effect on us, meaning that theoretically H. sapiens can persist unchanged for many, many millions of years. Theoretically. And then, why not?
Let's say we eat ourselves into a cataclysmic disaster - an apocallypse if you will - 99,9% die out (best case scenario!) - more food for survivors! Plus - now the world is like a gigantic Norway - a huge planet, tons of technological knowledge - but very few people to share the wealth between

A huge wealth-per-capita
now imagine again that we are only in the infancy of our species, that we have tens of millions of years to keep going
Cataclysmic events may become episodic in our species' future

The "big end of the world" we write about in our bibles and verses, it may end up becoming a kind of routine, happening every half a million years or so. Our species has allready "broken" many "rules", we are the anarchists of nature, and if - IF - we finally manage to get the hang of space travel, planet hopping, well - the universe would have "done it" then, creating us - now for never to get rid of us: EVER.
EVER.
When we have the ability to move from one world to another, we no longer have any reason to ever go extinct, at least not untill the universe itself unravels.
Our best hope is something that does not kill 99,9% of us - but 100%, well "best hope", depending on what you want for our future I guess.