PeterDonis said:
The question of whether there can still be *any* temperature gradient in a body at equilibrium is more complicated, and I'll discuss it in a separate post after I've thought about it some more.
I'm still thinking, but I have at least a basic heuristic picture that I want to go ahead and post.
Consider the following situation: we have two surfaces, similar to what zonde proposed in his "mirror" scenario, but without the mirrors.
Surface R is the surface of a gravitating body. We don't care what it's made of except that it is in some kind of static equilibrium. It is at some radius r.
Surface S is a surface above the gravitating body, at which the radiation temperature is in equilibrium with the CMBR; in other words, we are assuming there is basically a "heat bath" from this surface outward that is at a constant uniform temperature of 2.7 K (the CMBR temperature). Surface S is at some radius s which is larger than r, enough so that there is a measurable gravitational redshift/blueshift between the two surfaces.
Note that we will assume that surface S does not move; its radius s is constant. However, we will see that we need to allow surface R to move; its radius r may change.
Let's suppose that surface R starts out at the *same* temperature as surface S, 2.7 K. What will happen? Well, since the radiation coming into R from S is blueshifted, it will be at some temperature higher than 2.7 K. The outgoing radiation from R to S will be similarly redshifted, but there is a heat bath at S so S's temperature won't change (some extra heat from the heat bath is simply taken to compensate for the reduced heat coming from R). So the temperature at R will rise. This means that the total energy contained in the gravitating body whose surface is R will rise.
Can the body simply radiate this energy away and return to its original equilibrium, at 2.7 K at radius r? I don't see how, because the blueshifted radiation from S will keep on coming in and increasing its temperature again. So the body has to reach some new static equilibrium configuration that includes the extra energy.
How will R change its configuration to accommodate this increased energy? There are only three possibilities:
(1) It could stay at the same radius r. This would require the density and pressure in its interior to increase, until its temperature at the surface (R at the original radius r) was equal to the blueshifted temperature of the incoming radiation from S.
(2) It could *decrease* its radius, but compensate by increasing density and pressure even more than in #1 above, so that its surface temperature at the new smaller radius would be equal to the (higher) blueshifted temperature of radiation from S at that smaller radius.
(3) It could increase in radius until it came to a new equilibrium with a higher surface temperature that was just equal to the blueshifted temperature of incoming radiation from S at the larger radius (i.e., higher than 2.7 K, but not as high as in #1 above). In this case, it would be possible in principle for the central density and pressure of the body to be unchanged, by making the gradients of both gentler than they were before.
I believe that the only one of the above possibilities that would actually be realized is #3. This is because #1 and #2 both require the pressure in the body's interior to increase, and the natural outcome of that is for the body to expand. So while I could see #1 (or less likely #2) happening as part of a transient condition, I can't see them as a new stable equilibrium. Only #3 looks to me like a possible new stable equilibrium. (There may well be some slick argument based on the equations of hydrostatic equilibrium that makes this obvious.)
So we have two conclusions. First, at the surface of a gravitating body, where the only heat exchange with the rest of the universe is by radiation, the equilibrium temperature will be the "blueshifted" temperature of the background radiation of the universe as a whole. Thermal equilibrium maintained by radiation through vacuum *does* have to take into account the gravitational redshift/blueshift. Second, the body as a whole equilibrates itself to the background radiation temperature, properly blueshifted, by adjusting its radius.
What I'm wondering is whether the above analysis still applies when we look at the interior of the body, its temperature profile and heat transfer within it. I'm not sure it does, because the interior of the body is not vacuum. That adds two factors that may make a difference: first, there is nonzero pressure inside the body, whereas pressure in vacuum is zero; and the interior of the body can move heat around in other ways besides radiation. I'm still thinking about how that affects the analysis.