(a) In both tubes the oil is broken up by the shaking into tiny droplets spread through the water, so the liquid looks mixed and the separate oil and water layers cannot be seen just after shaking.
(b) The oil separates out first in tube A. Oil does not dissolve in water. Without soap, nothing keeps the tiny oil droplets apart, so they quickly run together into larger drops, and being lighter than water they rise and form an oil layer on top again.
(c) A soap molecule has two different ends: a long hydrocarbon tail, which interacts with oil but not with water, and an ionic end, which interacts with water. At the boundary the tails dip into the oil droplet and the ionic ends point outwards into the water.
(d) Many soap molecules surround each oil droplet in this way, forming a cluster called a micelle, with the oil collected at the centre and the ionic ends on the outside facing the water. The outside of each droplet is now made of ends that interact with water, so the droplet stays suspended in the water. The oil and water have formed an emulsion, so in tube B the oil stays dispersed for a long time.
(e) Most dirt on clothes is oily, so water alone cannot remove it. In soap solution the hydrocarbon tails of soap molecules dissolve in the oily dirt on the cloth while the ionic ends stay in the water. The soap molecules pull the oily dirt off the fibres and enclose it in micelles, which stay dispersed in the water. When the cloth is rinsed, the micelles, with the dirt inside them, are washed away with the water and the cloth is clean.

A soap molecule and the micelle it forms around a droplet of oil.