Involutory functions and Moore-Penrose inverses of matrices in an arbitrary field