This method doesn’t always work though your answer is correct here. Descartes’ Sign rule only gives the maximum number of real positive and real negative, but there doesn't need to be those many roots of the equation. For Eg:
$f(x)=x^7+5x^5+x^3-3x^2+3x-7$
The above function $f(x)$ has 3 sign changes but has only one root i.e. $x=1$. All the other roots are imaginary because the function $f(x)$ is strictly increasing.