Functions Preserving Matrix Groups and Iterations for the Matrix Square Root