A polymer melt is a dense viscoelastic liquid. At short time scales, it will behave as a solid material, but since the molecules can move freely, at very long time scales it remains a liquid. When the polymer molecules are chemically cross-linked, they can no longer move freely. The result is an amorphous elastic solid material, where the elastic properties are determined by the density and the functionality of the chemical cross-links.
Rubber is an example of a cross-linked polymer liquid. If we stop and think about it, rubber has amazing and exotic behaviours. It can be stretched to about a factor of 10 times its original size, and yet returns to the unstrained original form when being released. To compare, a metal would for instance show permanent plastic deformation after a few percent of deformation. Polymer materials also contract when heated, while all other materials expand upon heating.
Why can rubber sustain such large deformations without breaking? The answer to both questions lies in the molecular structure. Polymer molecules are long flexible chains, that adopt random-walk like configurations. When we deform a polymer material, the random walk configurations can be pulled taught which releases excess length without ever affecting the length of the chemical bonds.
How does a rubber duck remember it's original form? Since the polymers are chemically cross-linked, they remember who they are connected to. Hence when the stress is released, all the molecules not only returns to the unstrained random-walk like conformations, but they also return to their neighbours with which they were chemically bound before the deformation. In fact, a piece of rubber can be regarded as a single molecule, and the cross-links acts as a memory of the unstrained shape of the rubber.
Why does polymer materials contract when heated? This answer lies again in the random-walk configurations of the polymer chains. Polymers can adopt a huge number of conformations, which means that the free energy of the material is completely dominated by the conformational entropy. When a polymer is stretched and heated it contracts. Stretching perturbs the polymer conformations and hence reduce their entropy. When heating, the polymers respond by contracting which increases their entropy because more conformations become available.