Let's start with $$\int_{-\pi}^\pi p(x)dx = 0$$Note that for all of the terms with $x$ having an odd degree, the integral of the function will have that term with even degree, so substituting $\pi$ for $x$ or $-\pi$ will produce the same value. This gives us our key insight: We solely care about the terms with even degree. Hence, the above integral becomes $$2\pi(a_0+\frac{a_2}3\pi^2+\frac{a_4}5\pi^4+\frac{a_6}7\pi^6)=0\to a_0+\frac{a_2}3\pi^2+\frac{a_4}5\pi^4+\frac{a_6}7\pi^6 =0$$We can similarly construct equations with $k=1,2,...6$ to get $$\frac{a_1}3+\frac{a_3}5\pi^2+\frac{a_5}7\pi^4+\frac{a_7}9\pi^6=0$$$$\frac{a_0}3+\frac{a_2}5\pi^2+\frac{a_4}7\pi^4+\frac{a_6}9\pi^6=0$$$$\frac{a_1}5+\frac{a_3}7\pi^2+\frac{a_5}9\pi^4+\frac{a_7}{11}\pi^6=0$$$$\frac{a_0}5+\frac{a_2}7\pi^2+\frac{a_4}9\pi^4+\frac{a_6}{11}\pi^6=0$$$$\frac{a_1}7+\frac{a_3}9\pi^2+\frac{a_5}{11}\pi^4+\frac{a_7}{13}\pi^6=0$$$$\frac{a_0}7+\frac{a_2}9\pi^2+\frac{a_4}{11}\pi^4+\frac{a_6}{13}\pi^6=0$$And finally, we have one equation due to the condition that $p(\pi)=\sqrt{3}$.$$a_0+a_1\pi+a_2\pi^2+a_3\pi^3+a_4\pi^4+a_5\pi^5+a_6\pi^6+a_7\pi^7=\sqrt{3}$$
After solving this system of equations, what you find is that the only coefficients of the polynomial that are non-zero are those of the odd terms! This means that the function is odd, i.e., $p(x)=-p(-x)$. Moreover, since $a_0=0$, we know that $$p(-\pi)=-\sqrt 3$$$$p(0)=0$$