Ah yes, this is a trend that has been seen out on the mountains very often lately, especially from freeskiers and pros. The truth on this trend is that it’s more about fashion than function to wear a hat underneath your helmet.
All helmets should be lined and insulated enough to keep your head warm; they are typically warmer than hats themselves. Some people still choose to wear a hat under their helmet either for the fashion aspect or because they truly get that cold, and there’s nothing wrong with this. Just make sure your helmet still fits properly and is worn correctly to protect your head. Many people who wear a hat underneath their helmet tend to wear their helmet too far back on their head, thus exposing their forehead and preventing it from being protecting in a crash or bump. Your helmet should sit low on your forehead and have little to no gap between it and your ski goggles.
My suggestion here if you are just looking for added warmth under your helmet would be a skull liner or helmet liner, such as the Seirus Micro Dome or the Turtle Fur Bamboo Frost Liner Hat. These will provide maximum warmth with minimum bulk, while ensuring that your helmet will still fit properly on your head.