For any positive integer $k$, the trigonometric function $\cos ky$ is a polynomial in $\cos y$. For example, with $k = 2$,
$$
\cos 2y = 2\cos^2 y - 1.
$$
The polynomial here is $T_2(u) = 2u^2 - 1$. In order to express $\cos y$ in terms of $\cos 2y$ (this is equivalent to expressing $\cos \frac{x}{2}$ in terms of $\cos x$ via the substitution $y = 2x$), we have to invert the polynomial function $T_2$.
In other words, you have to solve $v = 2u^2 - 1$ for $u$. This doesn't have a unique solution, but we can describe both possible solutions:
$$
u = \pm \sqrt{\frac{1 + v}{2}}.
$$
This is the well-known "half-angle formula for cosine"
$$
\cos \frac{x}{2} = \pm \sqrt{\frac{1 + \cos x}{2}}.
$$
For larger $k \in \mathbb{N}$, you have to solve the higher degree polynomial equations
$$
v = T_k(u)
$$
for $u$ in order to express $\cos \frac{x}{k}$ in terms of $\cos x$.