Fourier transform of even/odd function
Let $f: \mathbb{R} \to \mathbb{R}$ be an integrable function and let $\hat{f}$ denote its Fourier transform, i.e. $$ \hat{f}(\xi)=\int_\mathbb{R}e^{ix\xi}f(x)dx. $$ We have $$ \overline{\hat{f}(\xi)}=\hat{f}(-\xi)=\int_\mathbb{R}e^{-ix\xi}f(x)dx=\int_\mathbb{R}e^{iy\xi}f(-y)dy. $$ If $f$ is even then $$ \overline{\hat{f}(\xi)}=\hat{f}(-\xi)=\int_\mathbb{R}e^{iy\xi}f(y)dy=\hat{f}(\xi), $$ i.e. $\hat{f}$ is an even real-valued function.
If $f$ is odd then $$ \overline{\hat{f}(\xi)}=\hat{f}(-\xi)=\int_\mathbb{R}-e^{iy\xi}f(y)dy=-\hat{f}(\xi), $$ i.e. $\hat{f}$ is an odd purely imaginary function.
Define $F(p) = \int_{-L}^{L} f(x)e^{ipx} dx$. Note that: (let $u=-x$ so $x=-u$ and $dx=-du$ etc..)
$$ F(-p) = \int_{-L}^{L} f(x)e^{-ipx} dx = \int_{L}^{-L} f(-u)e^{ipu}(-du)=\int_{-L}^{L} f(-u)e^{ipu}du$$
Clearly $f(-x) = \pm f(x)$ implies $F(-p) = \pm F(p)$.
Now we turn to the reality part of the claim. Recall $e^{ipx} = \cos px+i\sin px$. Also, remark sine is an odd function whereas cosine is an even function. We know from elementary calculus that the integral of an odd function on $[-L,L]$ vanishes.
When $f$ is even then $f(x)\cos(px)$ is even and $f(x)\sin(px)$ is odd. It follows that the imaginary part of Fourier transform vanishes. Consequently, $F(p)$ is real.
When $f$ is odd then $f(x)\cos(px)$ is odd and $f(x)\sin(px)$ is even. It follows that the real part of Fourier transform vanishes. Consequently, $F(p)$ is imaginary.