Is a white dwarf hotter than a Red Giant?
"White" stars are typically much brighter than Red stars, as both the "color & brightness" of a star are directly proportional to the temperature. The only reason there are "bright" red stars is that their radius is incredibly large. Note that the "color" of a star is directly linked to the temperature.
The equation that best demonstrates this is the luminosity equation of a black body. Stars aren't perfect black bodies, but they are close enough that they are treated as such.
L = 4πR²σT⁴
this equation tells us that the Luminosity (L) is proportionate to the Radius Squared (R²) and the Temperature to the Fourth power (T⁴). The bigger the brighter, or, the hotter the brighter. Meaning that for a given radius the hotter the star, the more luminous, and the same goes for stars of the same temperature, the larger the radius the more luminous.
White dwarfs on the other hand are not stars in the sense that they do not fuse anything, they simply glow due to the lingering heat that was generated during their time as stars.
As shown in the HR-Diagram, White Dwarfs are some of the hottest objects in the universe, and as stated by agtoever there has not been enough time for even the oldest white dwarf to have cooled passed something like 4800K.
White dwarfs start hotter when they are created (up to billions degrees Kelvin), but in the end, they end as black dwarfs, which only happens after a few billion years. As per the age of the universe, it is currently the assumption that there are no black dwarfs yet.
Red giants are (on the surface) typically below 5000 K. Their core is up to a billion degrees Kelvin.
This might be an interesting link too.
As a final note: white dwarfs are the end stage of a star's life. Depending on the mass of the star, red giants can end up as white dwarfs. About 97% of the milky way stars will end as white dwarfs (including our sun).
But it is only the core which remains. So, from where do white dwarfs get so much energy? By fusing heavier elements?
Less than 5000K isn't much for a star that had a core of a billion degrees K. It doesn't have an energy source any more; only residual heat from the earlier phase of life. As stated in the Wiki link to White dwarfs: "A white dwarf is very hot when it is formed, but since it has no source of energy, it will gradually radiate away its energy and cool."
So, is the residual heat so much that it makes the star hotter than a red giant?
Yes. The residual heat of the **core** of the former red dwarf (millions up to a billion kelvin) is initially very much warmer than de **surface temerature** of the former red dwarf (up to 5000K).
This is very inaccurate. White dwarfs are born with *interior* temperatures of about 100 million K and surface temperatures of 100,000 K. The oldest white dwarfs in the universe are about 10 billion years old, still have interior temperatures of a million degrees and surface temperatures of about 4000 K.