Is it possible to prevent water from cooling by keeping it in an rigid container? If you fill a soft plastic water bottle with hot water, close the lid, then cool the water down, the bottle will contract. When you open it up, it will expand again.
Conversely, if you used a hard plastic water bottle instead, it would not contract. I assume there would be some kind of pressure built up inside the bottle though.
Is it possible to create a similar situation in which the water is unable to cool down past a certain point because the container would need to contract, and the material is too strong to do so? Possibly on a much larger scale?
I'm pretty sure the answer is no, but I'm curious as to why.
 A: short answer, no equations:
The only way to keep thermal energy (heat) from flowing into/out of an object is to isolate it; otherwise heat will flow from hot to cold. So your hypothetical container of hot liquid will eventually reach the outside temperature, even if the container is strong enough to resist any change in volume. What will be different about the liquid is it will be under considerable negative pressure; in other words, it will exert a contracting force on the walls of it's container, and you could get energy out of this scenario by allowing one wall of the container to move (like a piston, for example). 
with equations:
The first law of thermodynamics is:
$$ Q = \Delta E + W $$
Where $E$ is the internal energy of the system, $W$ is work done by the system, and $Q$ is the heat added (positive) or removed (negative) from the system. The system is your liquid plus container. When you put a hot liquid in a container and allow it to cool, you take heat out of the system and $Q$ is negative. The first law says that can either change the internal energy $E$, do work $W$, or some combination of both. 


*

*The container can change volume. If this is true, then work can be done by the liquid, and this means it contracts (i.e. does negative Work): $-Q = -W$. The change in internal energy after the liquid reaches room temperature will be zero (no stored energy).

*The container cannot change volume. If this is true, then no work can be done ($W=0$) by the liquid. Any loss in heat must be accompanied by a loss of internal energy: $-Q = -\Delta E$. Since this is stored energy, you can get it back by then allowing the container to change volume. Work would then be done, and you would end up in the same end state as (1).

A: For a soft, thermally conducting bottle, the volume of the contents can change, but the pressure is held constant - it must equal the pressure of the room the bottle is in.  So as the temperature of the contents decreases, so does the volume.  
For a hard, thermally conducting bottle, the volume of the contents cannot change, but the pressure can.  In this case, as the temperature of the contents decreases, so does the pressure.  
This is true for common situations, be it liquid or gas, as long as the contents do not go through a phase change as they change temperature.  
To answer your question, no, we cannot prevent the temperature from dropping by using a hard container - the container still conducts temperature.  The pressure just drops instead of the volume.  
A: As others have mentioned, the water will eventually cool down until it's in thermal equilibrium with its environment, i.e., it has the same temperature as the room.
Cooler water (above 4°C) is more dense than warmer water, and so the volume of the cooled water is less than the original water volume. Liquid water is almost incompressible, so you can't reduce its volume (by any significant amount) by applying pressure, and neither can you increase its volume by reducing the pressure on it. That is, you can't stretch water. However, if you subject liquid water to a vacuum some of the liquid will change state and become water vapour until the vapour pressure is in equilibrium with the liquid, with the vapour pressure being dependent on the temperature in a non-linear way (the intermolecular forces of water are rather strong, so it does not behave like an ideal gas).
For example, let's say our container has a volume of 1 $m^3$ = 1000 $L$, and we fill it with water at 90°C. (Assume that any air that was dissolved in the water has been driven off by the heating process). Let the ambient temperature of the room be 20°C. According to Wolfram Alpha, the densities of water at those temperatures are:
20°C : 965.3 $kg/m^3$
90°C : 998.2 $kg/m^3$  
Wikipedia says that water vapour at 20°C has a pressure of 2.3388 kPa or 0.0231 atmospheres. In other words, water boils at 20°C if the ambient pressure is 2.3388 kPa. 
We have 998.2 $kg$ of water in our 1 $m^3$ rigid sealed container. When the water temperature drops to 20°C, its volume reduces to $965.3 / 998.2 = 0.9670 m^3$ leaving $1 - 0.9670 = 0.033 m^3 = 33 L$ for the water vapour. Those numbers aren't quite correct because some of the liquid is turned into vapour, but the volume of liquid lost is tiny compared to the total volume of liquid.
This site gives a figure of 17.3 $g/m^3$ for the density of water vapour at 20°C. So the mass of water in our vapour "pocket" is around 0.033 * 17.3 = 0.57 $g$, and the amount of liquid lost is around 57 $mL$, which is insignificant compare to 967 $L$.

The fact that water can't be stretched has important ramifications, as discussed in the Wikipedia article on cavitation.
A: The cooling causes the contraction, not the other way around. In fact, the contraction partially counteracts the cooling. This is because when the bottle contracts, work is done on the bottle, increasing its internal energy. So in a rigid container, the liquid would cool faster.
A: Heat flows from hot to cold (unless you have infinite insulation).  The water will reach the outside temperature.
Assume the water started at 1 atm and 100 F.  If it is cooled to 80 F the volume of water will decrease (very slightly).  The void will be filled with water vapor.  The pressure will be the vapor pressure of water at 80 F. The gas will be 80 F.    
No work is done on the bottle. 
A: If you enclose a volume of water completely with a flexible (perfect flexibily doesn't exist though), heat conducting material, the water will not increase that much with increasing temperature. If you put hot(say just beneath boiling point) water in a soft bottle and let it cool the whole cool down (say to zero degrees Celcius), the bottle will "follow" the volume of the enclosed water. Below around four degrees Celsius the bottle will expand again (because of the unique property that water has a minimum volume not at freezing point but some four degrees above it). Lowering the temperature more (below zero) will freeze the water and the material that encloses the water will expand because ice has a bigger volume than water.
If the water is enclosed by a rigid (a perfectly rigid material doesn't exist), heat conducting material the same will happen as in the case with the flexible material (perfect flexible) flexible material, but the pressure inside the material will show a different pressure behavior (with respect to the temperature; see for example here). the water won't freeze at exactly zero degrees (as is the case with the flexible material, but in this case, the effect is more pronounced).
So indeed, the answer is no.
A: You're confusing here the behaviour of the gas in the bottle and the liquid itself. I think it’s much less confusing to treat these cases separately. 
I liquid in a closed contained would in fact never cool down if the container was perfectly isolated- energy is conserved in a closed system. 
As for a gas, essentially the same answer, but here enters the heart of your question which comes down to the relation of temperature and available volume and pressure. Assuming the gas is ideal, remember the ideal gas law:
$$PV=nRT.$$
So in this case the gas will heat up/cool down when you allow the volume of the container to increase/decrease whilst keeping constant pressure and prevent leakage of energy/particles. 
