Just to say, there is no known way this could happen astronomically, except in movies. First, from the cratering record we can see that no asteroid that big has hit any of the planets Earth, Mars, Venus (for the last few hundred million years which is all we have because of its global resurfacing by lava flows), or our Moon or the moons of Mars for over three billion years. Largest ones were 10 - 20 km in size.
Also there is no way any really big asteroid could hit us with only one week notice. Our new telescopes such as Pan-STARRS in Hawaii can spot a 10 km asteroid well beyond the orbit of Jupiter and has mapped all the Near Earth Objects of 10 km size or larger (and 90% of the 1 km asteroids, finds a new one of those every month and expects to reach 99% in the 2020s).
So we would have more than half a year of notice of any really big asteroid approaching Earth from the outer solar system. That's for asteroids of 10 km upwards. Some humans at least would surely survive such an impact, in fireproof shelters (which the dinosaurs didn't have), in submarines, or for that matter just by traveling to the opposite side of the world and keeping away from anything that could burn in a firestorm, and protecting themselves as best they can from the worst of the meteorite debris of smaller meteorites that would start falling over the entire world after the impact (underground shelters etc). And you'd do your best to stockpile food for the years following, preserve important seeds and animals, and so on. The dinosaurs couldn't do this - if they could they would probably still be here.
They can also be deflected however, given enough lead time, as it only requires a fraction of a meter per second change in delta v to eventually shift it far enough in its orbit to miss Earth a few years later. It is the one natural disaster that can not only be predicted to the minute given enough data - but also prevented, if you have sufficient lead time.
RISK FROM A SMALLER ASTEROID
You could be hit by a smaller asteroid - though so far there are no confirmed cases of anyone killed by an asteroid in recorded history. It's an improbable event, much more likely to die in other ways. But there is a tiny chance, statistically about 91 people a year on average could expect to be killed by asteroids every year - but that's averaged over millions of years. At present equally divided between the smaller asteroids and the ones of 0ne kilometer size or larger. But so rare that it could be centuries before anything like that happens. Even for the 100 meter size asteroid, we'd expect one every thousand years or so.
This probability will go down once we reach the target of finding 90% of all asteroids of 140 meters or larger, then the expected number of people to die per year from asteroids will drop to 31, unless of course we find an asteroid headed our way by then - in which case will be a matter of finding out how to deflect it, or for the more likely smaller ones, just evacuate the impact zone.
For the statistics, see graph on page 322 of "Estimating the NEO Population and Impact Risk: Past, Present and Future
After discovery of 90% of the 140 meter or larger asteroids, whenever that happens - mandate by Congress is to find them somehow by the 2020s, the curve will be
OTHER WAYS WE COULD DIE
There are several other possibilities including a gamma ray burst, for instance. But there are no known nearby stars likely to go supernova or produce a gamma ray burst close enough to make us extinct at present, or for millions of years into the future.
Basically we can forget about worrying about natural human extinction causing events at present. It certainly could happen over the timescale of hundreds of millions of years, but there is no imminent possibility.
WHAT DOES IT MATTER IF EVERYONE DIES OR JUST ME
In any case why would everyone go crazy if they know we are going to go extinct?
We don't have any experience of this to go on, but something similar happens to many people every year who are told they have only weeks or months to live, due to a medical condition, or could be even less time than that. They don't go mad, go out shop lifting, commit crimes, try to escape to mountains etc.
If there was a chance of escaping, then of course you'd do your best to find a way. But if not, well it is just like finding out you have cancer. Why panic if there is nothing you can do about it?
So, I don't think we'd get world wide panic myself if we found the Earth was about to be destroyed. Shock yes. Gradually coming to terms with it. Some people might go a bit crazy, but it's really not that much different from all of us simultaneously being told we have a medical condition which means we have only a week left of our life.
You would get the panic conditions if there was a chance of survival, but only a few people could survive. I think you'd just get shock, not panic, if nobody can survive.
I know this doesn't directly answer the question, rather it goes to the assumptions behind the question.
But to answer the question - not that much different from what I'd do if I had only a week to live. There's a story about the Tibetans when they knew that the Chinese were invading Tibet and destroying their buildings and traces of the Tibetan religion which they saw as contrary to their own communist beliefs. Deeply religious, the Tibetans affirmed their beliefs and celebrated their way of life by building new monasteries and stupas, knowing that they would be destroyed.
I think something like that would be a good way to proceed, To do something positive, something you feel is really worthwhile. Whatever that might be, which of course will be different for different people. Even though it is due to be destroyed.
And to help others, comfort them, do what you can from your love, compassion, and wisdom - even with just a week for everyone, there is much you can do to help others just as you can help someone who is dying of cancer in the last week of their life just being there with them.
But we don't need to worry about it as there is no immediate chance of it happening for probably hundreds of millions of years. Enough time probably for humans to evolve again a second time from the smallest microscopic multi-cellular lifeforms. And who knows what the situation might be then?
For more on this, see Giant Asteroid Headed Your Way? - How We Can Detect And Deflect Them