You know that
$$f(x) = \frac{a_0}{2} + \sum_{n = 1}^\infty (a_n \cos(nx) + b_n\sin(nx)), \quad x \in [-\pi,\pi].$$
So
$$\int_{-\pi}^\pi f(x)g(x)\, dx = \frac{a_0}{2}\int_{-\pi}^\pi g(x)\, dx + \sum_{n = 1}^\infty \left(a_n \int_{-\pi}^\pi \cos(nx)g(x)\, dx + b_n \int_{-\pi}^\pi \sin(nx)g(x)\, dx\right).$$
This step is justified by the uniform convergence assumptions given in the problem. By definition of the Fourier coefficients $\alpha_n$ and $\beta_n$, we have
$$\pi \alpha_0 = \int_{-\pi}^\pi g(x)\, dx,$$
$$\pi \alpha_n = \int_{-\pi}^\pi \cos(nx)g(x)\, dx,\quad n \ge 1$$
and
$$\pi \beta_n = \int_{-\pi}^\pi \sin(nx)g(x)\, dx,\quad n \ge 1.$$
Therefore
$$\int_{-\pi}^\pi f(x)g(x)\, dx = \frac{\pi a_0\alpha_0}{2} + \sum_{n = 1}^\infty (\pi a_n\alpha_n + \pi b_n \beta_n),$$
or
$$\int_{-\pi}^\pi f(x)g(x)\, dx = \frac{a_0 \alpha_0}{2} + \sum_{n = 1}^\infty (a_n \alpha_n + b_n \beta_n).$$
Best Answer
Yes, you have to consider symmetries around $\pi/2$. Let me show you an example. Let $f\colon[-\pi,\pi]\to\mathbb{R}$ be an odd continuous function. Then it's Fourier series has only sine terms: $$ f\sim\sum_{n=1}^\infty b_n\sin(n\,x),\quad b_n=\frac{2}{\pi}\int_0^\pi f(x)\sin(n\,x)\,dx. $$ Suppose further that $f$ satisfies $f(\pi-x)=f(x)$ if $0\le x\le\pi$. Then for all $n\in\mathbb{N}$ $$ \int_0^\pi f(x)\sin(2\,n\,x)\,dx=\int_0^\pi f(\pi-x)\sin(2\,n\,\pi-2\,n\,x)\,dx=-\int_0^\pi f(x)\sin(n\,x)\,dx. $$ This implies that $b_{2n}=0$.
If $f(\pi-x)=-f(x)$, then $b_{2n+1}=0$. You can find similar conditions for cosine series.