The main function of centroblasts is to undergo rapid proliferation and somatic hypermutation. These processes are essential for the generation of B cells with high-affinity receptors for antigens. Centroblasts also contribute to class switch recombination, a mechanism that changes the antibody class produced by B cells, enabling them to effectively combat different types of pathogens.