Consider $\mathcal{C}[-\pi/2,\pi/2]$ the vectorial $\mathbb{R}$ space of continuous real functions in $[-\pi/2,\pi/2]$. For $f,g \in \mathcal{C}[-\pi/2,\pi/2]$ define
$$\left \langle f,g \right \rangle=\int_{-\pi/2}^{\pi/2}\cos(t)f(t)g(t)dt.$$
Prove $\left \langle f,g \right \rangle$ defines an inner real product in $\mathcal{C}[-\frac{\pi}{2},\frac{\pi}{2}]$.
Attempt:
$\bullet$ Linearity follows from the linearity of the integral.
$\bullet$ Conjugate symmetry follows from $$\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\cos(t)f(t)g(t)dt=\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\cos(t)g(t)f(t)dt.$$
$\bullet$ If $0 \neq f \in \mathcal{C}[-\frac{\pi}{2},\frac{\pi}{2}]$, then $$\left \langle f|f \right \rangle=\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\cos(t)f^{2}(t)dt>0$$ because of the continuity of $f$, $f^{2}>0$, the continuity of $\cos$ and $\cos >0$ in $[-\frac{\pi}{2},\frac{\pi}{2}]$.
Since $\left \langle 0,0 \right \rangle=0$ holds, positive definiteness follows from
$\bullet$ Since $f\in \mathcal{C}[-\frac{\pi}{2},\frac{\pi}{2}]$, $f^{2} \geq 0$. Since $\cos >0$ in $[-\frac{\pi}{2},\frac{\pi}{2}]$, $\left \langle f,f \right \rangle=0\implies f=0$.
$\bullet$ If $f \in \mathcal{C}[-\frac{\pi}{2},\frac{\pi}{2}]$, $f^{2} \geq 0$. Since $\cos>0$ in $[-\frac{\pi}{2},\frac{\pi}{2}]$, $\left \langle f,f \right \rangle\geq 0,\forall f \in \mathcal{C}[-\frac{\pi}{2},\frac{\pi}{2}]$ follows.
$\therefore$ $\left \langle f,g \right \rangle$ defines an inner real product in $\mathcal{C}[-\frac{\pi}{2},\frac{\pi}{2}]$.
That is mostly correct. Generally you only need $\cos>0$, so you can do this with any function $w$ with $w>0$ and $w$ sufficiently nice to be integrable. This can then be seen as weighted variation of the standard ip with weight function $w$.