Final answer:
Restriction endonucleases in bacteria function as a defense mechanism against viral infection by recognizing and cleaving specific DNA sequences.
Step-by-step explanation:
Restriction endonucleases, also known as restriction enzymes, have a function in bacteria as a defense mechanism against infection by viruses (option b). These enzymes recognize specific DNA sequences, usually palindromic in nature, and cleave the DNA at those sites. This restriction process limits the replication of foreign DNA, such as viral DNA, within the bacterial cell.