What substance changes shape when egg is cooked?

The substance that changes shape when an egg is cooked is protein.

Here's why:

* Raw egg: In a raw egg, the protein molecules are loosely arranged and held together by weak bonds. This gives the egg its liquid consistency.

* Cooking: When you heat an egg, the heat breaks the weak bonds holding the protein molecules together. The protein molecules then unfold and rearrange themselves into new, more stable structures. This process is called denaturation.

* Cooked egg: As the protein molecules denature and rearrange, they form a network that traps water. This network gives the cooked egg its solid or semi-solid texture.

So, the change in shape you see when an egg is cooked is directly related to the denaturation of the protein molecules within the egg.