TL:DR It is plausible, probable, and in fact very likely, that at least a small portion of humanity will survive and indeed prosper if that event actually occured today. Further, if this question were asked, or this event occurs, in as little as ten years from now, the answer would be an even more certain 'yes'. Change that 'three month' lead time into a 'five year' lead time, and our chances are almost completely assured.
We already have technologies that would allow us to survive, and even more are in the pipeline, and are being ramped up. We are developing technologies that will allow us to survive in the depths of space, on very long journeys, on alien planets, and in very hostile environments. In fact, surviving under such conditions would be equivalent to surviving on the moon, during the lunar night, and even to some extent on Mars. Certainly, the first food production in these colonies will be biodome hydroponic based, using synthetic solar power (non-biological) technology. Replace solar power with nuclear power, and all of the other technologies we are developing for survival on these space habitats are relevant.
With full apologies to the answer provided by @Ash, unfortunately for America and the West, however, the most likely country to have any survival chances will be China, if this event happened today, with only a three month lead time. They are now the undisputed world leaders in advancing the necessary technology. (It is also worthy of note, that the Western news media is unfortunately deliberately obfuscating and downright censoring exactly how advanced China and Asia are in this area, and in fact are deliberately throwing roadblocks in the way to prevent China from developing the necessary technology. See this and this, for instance. Even Internet searches are being filtered. Legitimate sites highlighting Chinese technology advances that came up as late as last year, no longer show up in Google or Duck-duck-go.)
Basically, if Sci Fi writers can argue that Generation Ships are plausible, and people can survive hundreds of years on them, certainly humans can build the equivalent here on earth, and equaly survive for hundreds of years, probably longer. I do not see why @mjt was down-voted, as the answer just needed to be tweaked from humans building a Generation Ship, to humans creating the same concept here on Earth. That is, turn the Earth into a Generation Ship.
We already have aircraft carriers and submarines powered by nuclear rectors that can go years on their own power. They have been doing so safely for almost 50 years. But now, the technologies to do so are no longer military secrets, and small scale nuclear reactors are going into commercial production. Last year, a google search could get you the names of major corporations in China that were leading in the field. In fact, China is already well into commercial production of community-sized nuclear reactors, so the production facilities already exist. China and Asia, are the world leaders in small nuclear reactor technology, and the US are Johny-come-lately to the party. If anyone will survive, it will be because of these Small Modular Reactors (SMR's)that power our survival in local, even remote, enclaves.
We have biodomes in Canada's North, and in the sub-Arctic that can produce enough food to provide a small community, based entirely on artificial light. They have been built quickly, with limited resources. Combine one of these with a commercial community SMR nuclear reactor (at least one is being proposed already in Canada's North). Given the incentive of assured destruction, and the complete evaporation of any fiscal or economic barrier (money will become meaningless) humans can be mobilized into churning them out in mass in three months. A government that can quickly set policies in place, centralize administration, and mobiize the entire manufacturing and production of the country, will be best positioned to survive. Some countries, however, will be rendered impotent through partisan and ideological in-fighting, back-stabbing, political posturing, and blame-gaming while the citizenry dies off.
We already have in Canada underground salt caverns sufficiently large enough for a Generation Ship type environment, as one will realize if they take a tour of such caverns. Here are some pictures depicting how massive salt mines are. It would take a Herculean effort, but not beyond the capabilities of a determined socially responsive nation, to collectively outfit and stock these caves into shelters that could provide refuge in the short term. Incidentally, the interior temperature of the Gooderich salt mine is a balmy 70 degrees F, and this does not come from the sun, but from the Earth's core. Deeper mines have temperatures upwards of 130 degrees F or higher. Definitely not a deep freeze environment. Add hydroponics for food, and insects for protein, and you have a habitat that will be warm and cozzy for millenia. China, of course, has an abundance of such large cavernous mines, all at downright tropical temperatures.
Oh, and that oxygen thing? Here we have a distinct advantage over Generation Ships. We have an almost unlimited supply of water for electrolysis, given that we no longer have to share it with other life forms. The energy to drive the electrolysis? Did you read that 'mini nuclear reactor' thing? Not a practical solution, you might say. Yet American nuclear submarines get all the oxygen they need, for staying under water for perhaps years at a time, from the electrolysis of water using energy from their nuclear reactor. Except for food, a nuclear submarine is entirely self sustaining for every human need, completely independent of the sun, for years if necessary. Just up-scale the level to that of a large cave, and it is evident that human survival on a Generation Spaceship Earth is entirely feasible.
As for a practical, real-world example, again I have to turn to China. They have already completed (2018) and tested such a habitat, with inhabitants surviving for over a year in a completely enclosed, self-sustaiing module, as a proof of concept.
With all of these technologies currently in development, it is certainly feasible today, and when they are perfected within the next ten years, highly likely, that at least enough humans could survive such a catastrophe to maintain our existence.
After all, all humans arose from a population of only 5,000 or so after an extinction event some 50,000 t0 100,000 years ago. Humans with far less technology than we have today have survived ice ages, with very limited resources. They found a way, they adapted.