There is this theory that says that the whole Earth was once covered with snow and ice. How was it possible for life to survive this extreme state?
First, the "snowball earth", despite favoured by many scientists, is not a theory in the scientific meaning of the term, but a hypothesis, because it is not widely accepted: https://en.wikipedia.org/wiki/Snowball_Earth#Scientific_dispute. Some models show sea ice at the equator, while some more sophisticated climatic models failed to form sea ice to the equator.
But let's talk about the most famous "snowball earth" event, the Huronian Glaciation. It happened just after the "Great Oxygenation Event": the massive amounts of oxygen (O2) released in the atmosphere decreased methane concentration, and temperatures plummeted. It's supposed that Earth's surface became entirely or nearly entirely frozen.
How was it possible for life to survive this extreme state?
It's worth mentioning that, by that time (2 and half billion years ago), there were only unicellular organisms (and probably no eukaryotes, just bacteria). There were no pluricelular organisms nor life on land (outside water). Thus, having in mind that there were still a lot of liquid water (under the ice), it's easy to see those bacteria surviving. Sure, many species have become extinct, but not all life forms were threatened.
About the Huronian glaciation: