See the answer (here) for more information: Smooth functions which are invariant under a compact Lie group representation factor smoothly over the basic invariant polynomials. The factorization operator can be chosen linear and continuous.
Not mentioned in the answer above is the fact, that a certain subanalytic property of the image of the basic polynomial invariant mappings is responsible for the result: The most general version is in: MR1637671 (2000c:32027) Bierstone, Edward(3-TRNT); Milman, Pierre D.(3-TRNT) Geometric and differential properties of subanalytic sets. Ann. of Math. (2) 147 (1998), no. 3, 731–785.