Lac operon is operating in bacteria which consist of promoter, operator, regulator and a terminator. Operator region has 3 structural genes lacZ, lacY, and lacA.
X-gal is an organic compound consisting of galactose linked to a substituted indole like 5-bromo-4-chloro-3-indolyl-β-D-galactopyranoside. It has a glycosidic bond between galactose and indole group. Lac operon forms beta galactosidase which cleaves the glycodsidic bond. If lacI- mutant is provided with X-gal, because of mutant lacI gene, no repressor will be formed and hence the operon is swiched on. Beta galactosidase will be formed and it will cleave the glycosidic bond of X –gal which decreases its concentration over time.
X-gal gets cleaved to form 5-bromo-4-chloro-3-hydroxyindole which then dimerizes to derivative of indigo and hence blue color appears.