If humanity went undergroundwere to survive, there would need to move underground. They would need some sort of power. Some that could last a long time probably some form of nuclear power.You Could probably grow food using artificial sunlight the main problem would who got to live in these underground shelters and who didn't. Overpopulation and Limited resource could also be a problem long turm.
But I guess the overall answer to your question is yes. As long as you have a source of power to roduceproduce light and heat, and plants growing under artificial sunlight. Then yes it is possible that human life would continue.