The function of centrosomes is to maintain cell stability and initiate cell division.
Remember the arrays of microtubules created during mitosis, that pull daughter chromosomes towards the poles? They are produced from centrosomes.
Centrosomes are structures that are found inside of cells. They are only found inside of eukaryotic cells. Centrosomes are comprised of two centrioles that are essentially just rings of microtubules.
The purpose of the centrosome is to help organize microtubules (hollow tubes of protein, similar looking to microscopic hollow spaghetti) to be utilized during cell division. It also works to use the microtubules to create part of the cytoskeleton of the cell. This helps give the cell its structure. In a sense, the centrosome helps to stabilize the structure of the cell.
Centrosomes are associated with the nuclear membrane during the prophase stage of the cell cycle. In mitosis the nuclear membrane breaks down and the centrosome nucleated microtubules can interact with the chromosomes to build the mitotic spindle.
The mother centriole, the older of the two in the centriole pair, also has a central role in making cilia and flagella.