To prove that a regular septagon cannot be constructed by a straightedge and compass, it suffices to prove that $2\cos(\frac{2\pi}{7})$ is not constructible.
Several other answers to this question follow with the fact that $2\cos(\frac{2\pi}{7})$ is a root of
$$x^3 + x^2 - 2x -1$$
How do I derive that?
I know that since the cubic polynomial is irreducible in $\mathbb{Q}$, it has no real roots, implying that $\cos(\frac{2\pi}{7})$ is not constructible.
Let $a = \frac{2\pi}7$. Then, $ 4a = 2\pi-3a $ and
$$\cos4a = \cos3a$$
Use the identities $\cos 2t = 2\cos^2t -1$ and $\cos3t = 4\cos^3 t-3\cos t$ to expand the two sides
$$2(2\cos^2 a -1)^2 -1 = 4\cos^3a -3\cos a $$
After rearrangement
$$8\cos^4a -4\cos^3a -8\cos^2a +3\cos a+1=0$$
which factorizes as
$$(\cos a -1) (8\cos^3a + 4\cos^2a-4\cos a-1)=0$$
Since $\cos a \ne 1$, the equation above shows that $2\cos \frac{2\pi}7 $ satisfies
$$x^3+x^2 -2x-1=0$$