The lac repressor is a protein that regulates the transcription of the lactose operon in E. coli by binding to the operator region and preventing RNA polymerase from transcribing the genes needed for lactose metabolism. This protein plays a crucial role in the gene regulation process, responding to the presence or absence of lactose to control whether the operon is active or inactive, thus maintaining metabolic efficiency.