How could I continue to show the inequality? Let $g: [0, \pi]\rightarrow \mathbb{R}$ a $C^{\infty}$ function for which the following stands: 
$$g(0)=0 \ \ , \ \ g(\pi)=0$$ 
I have to show that $$\int_0^{\pi}g^2(x)dx \leq \int_0^{\pi}(g'(x))^2dx$$ using Parseval's formula. 
$$$$ 
I have done the following: 
The Fourier series of $g$ is $$g \sim \frac{a_0}{2}+\sum_{k=1}^{\infty}\left (a_k \cos (kx)+b_k \sin (kx)\right )$$ where $$a_0=\frac{2}{\pi}\int_0^{\pi}g(x)dx \\ a_k=\frac{2}{\pi}\int_0^{\pi}g(x)\cos (kx)dx \ \ , \ \ k=1, 2, \dots \\ b_k=\frac{2}{\pi}\int_0^{\pi}g(x)\sin (kx)dx \ \ , \ \ k=1, 2, \dots $$ 
From Parseval's formula we have the following: 
$$\int_0^{\pi}\left (\frac{a_0}{2}\right )^2dx+\sum_{k=1}^{\infty}\left (a_k^2\int_0^{\pi}\cos^2 (kx)dx+b_k^2\int_0^{\pi}\sin^2 (kx)dx\right )=\int_0^{\pi}g^2(x)dx \\ \Rightarrow \int_0^{\pi}g^2(x)dx=\frac{a_0^2}{4}\pi+\frac{\pi}{2}\sum_{k=1}^{\infty}\left (a_k^2+b_k^2\right )$$ 
The Fourier series of $g'$ is $$g'\sim \sum_{k=1}^{\infty}\left (kb_k\cos (kx)-ka_k\sin (kx)\right )$$ 
From Parseval's formula we have the following: 
$$\sum_{k=1}^{\infty}\left (k^2b_k^2\int_0^{\pi}\cos^2 (kx)dx+(-k)^2a_k^2\int_0^{\pi}\sin^2 (kx)dx\right )=\int_0^{\pi}(g'(x))^2dx \\ \Rightarrow \int_0^{\pi}(g'(x))^2dx=\frac{\pi}{2}\sum_{k=1}^{\infty}\left (k^2b_k^2+k^2a_k^2\right )$$ 
Is this correct?? Or have I done something wrong at the application of Parseval's formula?? 
How could I continue to show the inequality $$\int_0^{\pi}g^2(x)dx \leq \int_0^{\pi}(g'(x))^2dx$$ ?? 
$$$$ 

$$$$ 
EDIT: 
When we have to show with the Parseval's formula an inequality in which case do we have to take an expansion of the function that is involved at the inequality?? 
 A: Let $G:[-\pi,\pi] \to \mathbb{R}$ be defined by
$$ G(x) = \begin{cases} g(x) & \text{if } 0 \le x \le \pi \\
-g(-x) & \text{if } -\pi \le x < 0 \end{cases} $$
You can check that this function is continuous and differentiable (this is where the fact that $g(0) = 0$ is needed). Its derivative is given by
$$ G'(x) = \begin{cases} g'(x) & \text{if } 0 \le x \le \pi \\
g'(-x) & \text{if } -\pi \le x < 0 \end{cases} $$
Notice that $G'$ is continuous since $g$ is $C^\infty$.
Because $G$ is odd and $G'$ is even, their Fourier series have the following form :
\begin{align}
G &\sim \sum_{k=1}^\infty b_k \sin(kx) \\
G' &\sim \sum_{k=1}^\infty A_k \cos(kx)
\end{align}
Using integration by parts and the fact that $G(\pi) = G(-\pi) = 0$, we can show that $A_k = k b_k$ :
\begin{align*}
A_k &= \frac{1}{\pi} \int_{-\pi}^\pi G'(x)\cos(kx) \,dx \\
&= \frac{1}{\pi}\left[ G(x)\cos(kx) \right]_{x=-\pi}^{x=\pi}
   - \frac{1}{\pi} \int_{-\pi}^\pi G(x)(-k\sin(kx)) \,dx \\
&= k\frac{1}{\pi} \int_{-\pi}^\pi G(x)\sin(kx) \,dx \\
&= k b_k
\end{align*}
Since $G$ and $G'$ are both continuous and $2\pi$-periodic, we can now use
Parseval's formula to conclude the proof :
\begin{align*}
\int_0^\pi g(x)^2 \,dx &= \frac{1}{2} \int_{-\pi}^\pi G(x)^2 \,dx \\
&= \frac{\pi}{2} \sum_{k=1}^\infty b_k^2 \\
&\le \frac{\pi}{2} \sum_{k=1}^\infty k^2 b_k^2 \\
&= \frac{1}{2} \int_{-\pi}^\pi G'(x)^2 \,dx \\
&= \int_0^\pi g'(x)^2 \,dx
\end{align*}
A: Suppose g is absolutely continuous in $[0, \pi]$ and $g(0) = 0$.  Suppose further that  $g ‘$  is square integrable.   Take the half sine series of g, that is to say we extend g to an odd function G in $[ - \pi , \pi ]$.  Then  G is periodic, absolutely continuous of period $ 2 \pi $ and the derivative $ G’ $ is Lebesgue integrable and square integrable since $ g ‘$ is square integrable.
The next thing we need to use is the relation between the Fourier coefficients of  $G$ and the Fourier coefficients of $ G ‘$.
If   (0,  bn )  is the Fourier series of  $ G $ , then  (  n bn , 0) is the Fourier coefficients of $ G’ $.   More precisely the formal derived series of the Fourier series of G is the Fourier series of $ G ‘$. 
Now we can invoke Parseval Theorem, since $ G $ and $ G’ $ are square integrable, to get:
$\frac{1}{\pi }\int_{ - \pi }^\pi  {{G^2}(x)dx = \sum\limits_{n = 1}^\infty  {b_n^2} } $ and 
$\frac{1}{\pi }\int_{ - \pi }^\pi  {{{(G'(x))}^2}dx}  = \sum\limits_{n = 1}^\infty  {{n^2}b_n^2} $.
 Therefore,
 $\frac{2}{\pi }\int_0^\pi  {{g^2}(x)dx = \sum\limits_{n = 1}^\infty  {b_n^2} }  \le \sum\limits_{n = 1}^\infty  {{n^2}b_n^2}  = \frac{1}{\pi }\int_{ - \pi }^\pi  {{{(G')}^2}(x)dx}  = \frac{2}{\pi }\int_0^\pi  {{{(g')}^2}(x)dx} $  and 
$\int_0^\pi  {{g^2}(x)dx}  \le \int_0^\pi  {{{(g'(x))}^2}dx} .$ 
The key to this problem is square integrability and the condition to extend to a continuous periodic odd function. g being absolutely continuous means that its derived function is Lebesgue integrable but may not be square integrable so we make the assumption that $ g' $ is square integrable. If g is smooth then both g and $g'$ are continuous and so are both square integrable. For the extension to odd continuous function we just need to have $g(0) = 0$.  We do not need to expand the function as a Fourier series.  We do not need to use the convergence of the Fourier series.  
