At the time of death, a condition called “primary flaccidity" occurs
It’s one of the recognizable signs of death, caused by chemical changes in the muscles after death (later to be explained), causing the limbs of the corpse to become stiff and difficult to move or manipulate after the “primary flaccidity". Rigor Mortis is reason why the word “stiff" is a slang term for a dead body. It progresses in a downward, head-to-toe direction most likely because the muscle groups on the face are smaller than the ones that are of the lower limbs (which is called Nysten’s law).
Nysten’s law: Rigor Mortis affects first the muscles of mastication (eating muscles, jaw etc.), next those of the face and neck, then those of the trunk and arms, and last those of the legs and feet.
It begins with the eyelids, neck, and jaw and then follows (including the internal organs). In humans, it commences after about two to four hours, reaches maximum stiffness after 12 to 18 hours (at this stage, you can move the joints only by force, breaking them in the process), and gradually dissipates until approximately 48 to 60 hours after death (which is when decay starts to set in). If the position in which a body is found does not match the location where it is found (for example, if it is flat on its back with one arm sticking straight up), that could mean someone moved it.
Rigor Mortis can be massaged out by the mortician doing the embalming process. Embalming chemicals act to fix (denature- meaning they can’t work properly anymore) cellular proteins so they cannot act as a nutrient source for bacteria (embalming fluid also kills the bacteria themselves so they can’t decompose the body - at least for a while until new ones come along). Depending on the the formaldehyde, the body can be made into one that is pliable or become hard as a rock. Body features are “set" by the mortician prior to injection of embalming fluid and massaged into the tissues. Formaldehyde fixes tissue or cells irreversibly, the end result also creates the simulation, via color changes, of the appearance of blood flowing under the skin and makes up for the paleness of Pallor Mortis.
If the ambient (room) temperature is too close to body heat, Algor Mortis will be quicker, and this would mean the body will get stiff with Rigor Mortis quicker. If the body is kept cold, Rigor Mortis could be postponed even a few days.
The onset of rigor mortis is affected by the individual’s age, sex, physical condition, and muscular build.
Rigor mortis may not be perceivable in many infant and child corpses due to their smaller muscle mass. If there’s enough muscle mass in children, elderly and in those with a fever or a debilitating disease, it will progress quickly.
Physical exertion just prior to death: If someone dies while engaged in strenuous activity like exercising or struggling against drowning, rigor mortis can set in immediately (because this means more lactic acid being released and more muscles contracting even before death). This instant onset, sometimes called ‘cadaveric spasm’. This is why the victim of a violent attack may still be clutching the attacker’s hair or a piece of clothing, because the muscles remain locked with Rigor Mortis.
Fat acts as insulation, causing rigor mortis to develop more slowly.
Because rigor mortis leaves a lot of room for doubt, forensic pathologists rely on other indicators that provide greater certainty as to time of death. These include:
Body temperature: The body cools at the rate of 1.5 to 2 degrees per hour. A body that registers approximately 92 degrees Fahrenheit (33.33 degrees Celsius) has been dead about four hours.
Stomach contents: By determining the degree of digestion of the last meal, examiners can gauge how long the person lived after eating.
Insect activity: Flies gather around the eyes, mouth and other openings to feed on the body’s fluids. Forensic entomologists can determine approximately how long someone’s been dead by observing the life cycle of the flies, as well as their eggs and larvae.
When you lift a weight or scratch your head, a nerve impulse sets off a biochemical reaction that causes myosin to stick to actin. These two molecules lock together, pulling the muscle’s thick and thin filaments toward each other.
When thousands of filaments pull together all at once, over and over, you have a muscle contraction.
Once the actin and myosin molecules stick together, they stay that way until another molecule, adenosine triphosphate (ATP), attaches to the myosin and forces it to let go. Your body uses the oxygen you breathe to help make ATP. That oxygen supply ends, of course, with death. When the person can’t breath with oxygen and create ATP with it, the body resorts to breathing without oxygen, creating lactic acid in the muscles, pumping (or making it diffuse) calcium ions (lactic acid) to places where there are less of it and in here it bounds with troponin to let myosin and actin slide together. Without the new ATP that would normally come with breathing, the thick and thin filaments can’t slide away from each other (causing a permanent state of muscular contraction) until it starts to break down with enzymes or bacteria during decomposition.
During rigor mortis, another process called autolysis takes place. This is the self-digestion of the body’s cells. The walls of the cells give way, and their contents flow out. Rigor mortis ends not because the muscles relax, but because autolysis takes over. The muscles break down and become soft on their way to further decomposition.
Basically, a biochemical chain reaction that causes a living person’s muscles to move stops working when someone dies. When the reaction stops, the muscles become locked in place.
How muscles work: health.howstuffworks.com/human-body/systems/musculoskeletal/muscle.htm