We can survive global warming for sure. If we can build habitats on Mars we can do it on Earth. However there are many conditions far worse than global warming which we cannot protect ourselves from: All out nuclear war. Asteroid hitting earth etc.
It is stupid to put all eggs in one basket. Colonizing other planets in the solar system safeguards our future.
You got to start early because it is a very time consuming effort. You cannot suddenly begin colonizing Mars once you discover an asteroid on collision course. It will be too late.
It is an effort that will likely take far more than 100 years to complete.
Humanity also risk regression. Global warming while not killing us could cause such regression in our technological ability and science that we simply loose the ability to send things into space. We have been in dark ages many times before in history. It can happen again.
Really, for most planet-wide disasters the thing they do is force us to live a little bit like we'd have to on non-disaster-stricken Mars.
[EDIT] for the record I'm not against Martian exploration or even a Martian colony—I'm susceptible both to the "because it was there" and the "we'll come up with some cool tech in the process" arguments—I'm just very unconvinced Martian colonization is a good path to better survivability for the human species.
Why not allocate 0.00..001% of our resources to ensure that the only intelligent life we know of in the entire universe, has a life insurence.