<s>[INST] How to solve an equation of the form $f(x)=f(a)$ for a fixed real a. I got stuck on this question: find all solutions $x$ for $a\in R$:
$$\frac{(x^2-x+1)^3}{x^2(x-1)^2}=\frac{(a^2-a+1)^3}{a^2(a-1)^2}$$
I see that if we simplify we get:
$$\frac{(x^2-x+1)^3}{x^2(x-1)^2}=\frac{[(x-{\frac 12})^2+{\frac 34}]^3}{[(x-{\frac 12})^2-{\frac 14}]^2}$$
From the expression $(x-{\frac 12})^2$, I see that if $x=x_1$ is a solution, then $x=1-x_1$ is also a solution. But in the solution to this exercise, it was stated that $x=\frac{1}{x_1}$ must also be a solution, and I don't see how.
[EDIT]
Ok, thx for the help guys. What do you think of this solution (doesn't involve any above precalculus math, and needs no long calculations)?
From the above we know that if $x_1=a$ is a solution, then $x_2=1-a$ is also a solution.
Also, from here:
$$\require{cancel}\frac{(x^2-x+1)^3}{x^2(x-1)^2}=\frac{\cancel{x^3}(x+{\frac 1x}-1)^3}{\cancel{x^3}(x+{\frac 1x}-2)}$$
in the expression $x+{\frac 1x}$ we see that if $x=x_1$ is a solution, then $x=\frac{1}{x_1}$ is also a solution, so $x_3=\frac{1}{a}$.
With these two rules we can now keep generating roots until we have 6 total.
If $x=x_2$ is a solution, then $x=\frac{1}{x_2}$ is also a solution, so $x_4=\frac{1}{1-a}$.
If $x=x_3$ is a solution, then $x=1-x_3$ is also a solution, so $x_5=\frac{a-1}{a}$.
Finally, if $x=x_5$ is a solution, then $x=\frac{1}{x_5}$ is also a solution, so $x_6=\frac{a}{a-1}$
The 6 obtained values are distinct, so they cover all the roots.
[EDIT2]
I guess this is answered. No sure whose particular answer to actually select as the right one since they're all correct, so I'll just leave it like this.
 [/INST] Hint:  write the LHS in terms of $z = x+\cfrac{1}{x}$ as follows:
$$
\require{cancel}
\frac{(x^2-x+1)^3}{x^2(x-1)^2} = \frac{(x^2-x+1)^3}{x^2(x^2-2x+1)}= \frac{\bcancel{x^3}\left(x+\cfrac{1}{x}-1\right)^3}{\bcancel{x^3}\left(x+\cfrac{1}{x}-2\right)}=\frac{(z-1)^3}{z-2}
$$
Let $b=a+\cfrac{1}{a}$ and do the same for the RHS, then the equation becomes:
$$
\frac{(z-1)^3}{z-2} = \frac{(b-1)^3}{b-2}
$$
The above is a cubic in $z\,$ with the obvious root $z_1=b\,$, which leaves a quadratic to solve.
$$
\big(\,z-b\,\big) \,\big( \,(b-2)z^2 +(b-2)(b-3)z - (2b^2-6b+5)\,\big) \,=\, 0
$$
After not too pretty calculations, the other roots turn out to be:
$$
z_{2,3} = \frac{b^2 \pm (\sqrt{b^2 - 4} - 5) b \mp \sqrt{b^2 - 4} + 6}{4 - 2 b}
$$
Reverting to the $x$ and $a$ variables, the root $z_1=b$ gives the roots $x=a$ and $x=\cfrac{1}{a}\,$, then the roots $z_{2,3}$ give the other $4$ roots in $x$ after solving the respective equations. The calculations are again not pretty (and not included here), though noting $\sqrt{b^2-4}=a-\cfrac{1}{a}\,$ eliminates the radicals upfront.

[ EDIT ]  The following is a shortcut for the final calculations, using OP's observation that:


I see that if $x=x_1$ is a solution, then $x=1-x_1$ is also a solution.

This means that the second root in $z$ is $z_2=1-a + \cfrac{1}{1-a}\,$ corresponding to the roots $x=1-a$, $x=\cfrac{1}{1-a}\,$. The remaining root in $z$ as determined by Vieta's relations is:
$$\require{cancel}z_3=-(b-3)-\left(1-a + \cfrac{1}{1-a}\right)= -\bcancel{a}-\frac{1}{a}+3-1+\bcancel{a}-\frac{1}{1-a}=2 - \frac{1}{a}-\frac{1}{1-a}$$
Solving the equation $x+\cfrac{1}{x}=2 - \cfrac{1}{a}-\cfrac{1}{1-a}$ gives the last two roots $x=\cfrac{a}{a-1}\,$, $x=\cfrac{a-1}{a}$.

[ EDIT #2 ]  Even shorter: once established that if $x$ is a root then $1/x$ and $1-x$ are also roots, and given the obvious $x=a$ root, it follows that $\,1/a\,$, $\,1-a\,$, $\,1/(1-a)\,$, $\,1-1/a=(a-1)/a\,$, $\,1/(1-1/a)=a/(a-1)\,$ are also roots. For $a \ne 0,1$ and $a \not \in \{-1, \frac{1}{2},2\}$ the $6$ roots are distinct, and since the equation is of degree $\,6\,$, it follows that these are the only roots. For $a \in \{-1, \frac{1}{2},2\}$ the same can be shown to hold true by a continuity argument.
</s>