Here is the problem in Stewart "Calculus, early transcendentals, 9th edition"
My question is:
Why the wire is represented by $y$ in the equation that expresses the density? why $\bar{x} = 0$? what symmetry?
Could anyone help me answer this question please?


The wire occupies the semicircular arc in the $(x, y)$-plane which has symmetry across the $y$-axis, i.e. a point $(x, y)$ is on the curve if and only if its mirror image $(-x, y)$ is on the curve.
The density function also has $y$-axis symmetry, as it only depends on the vertical distance from the line $y=1$. Explicitly, this means that the density at a point $(x, y)$ is the same as the density at its mirror image point $(-x, y)$. How can you tell? The density function does not depend on $x$: $$ \rho(-x, y) = k\, (1-y) = \rho(x, y). $$
Since both the curve and the density are symmetric about the $y$-axis, the horizontal coordinate of the center-of-mass must be axis of symmetry, so $\overline{x} = 0$. You can set up an integral and calculate $\overline{x}$ by the usual methods, and you are guaranteed to get a value of $0$ because of this symmetry. Here it is in general.
Claim. If both the curve $C$ and the density $\rho(x, y)$ are symmetric about the $y$-axis, then $\overline{x} = 0$.
Proof. Break the curve into two pieces $C = C_- \cup C_+$, where each point $(x, y) \in C_+$ has a mirror-image point $(-x, y) \in C_-$, and the two pieces only overlap in finitely many points. Then, with the substitution $u = -x$, the points in $C_-$ are swapped with their mirror images in $C_+$ and the arc length differential doesn't change, so \begin{align} \overline{x} &= \int_C x \, \rho(x, y) \, ds \\ &= \int_{C_+} x \, \rho(x, y) \, ds + \int_{C_-} x \, \rho(x, y) \, ds \\ &= \int_{C_+} x \, \rho(x, y) \, ds + \int_{C_+} (-u) \, \rho(-u, y) \, ds \\ &= \int_{C_+} x \, \rho(x, y) \, ds - \int_{C_+} u \, \rho(u, y) \, ds \end{align} But those last two integrals are identical with opposite signs, so $\overline{x} = 0$.
An analogous argument would show that $\overline{y} = 0$ for a density distribution and a curve that both have symmetry across the $x$-axis.