The usual inner product defined for $P( \mathbb{R})$ - vector space of polynomials - is:
$\int_a^b p(t).q(t) dt$ , where $p, q ∈ P( \mathbb{R})$ and $a, b ∈ \mathbb{R} $
Why isn't this inner product valid for $C( \mathbb{R})$ - vector space of continuous functions $\mathbb{R} ⇒ \mathbb{R}$ - while it is valid for $C([a,b])$ ?
If you define $\langle f,g\rangle=\int_a^b f(t)g(t)\,dt$, you cannot detect anything that happens outside of $[a,b]$. In particular, one of the requirements of an inner product is that $\langle f,f\rangle=0$ implies that $f=0$. If you consider functions in $C(X)$ with $[a,b]\subsetneq X$, then there exist continuous functions that are zero on $[a,b]$ but not elsewhere; such functions satisfy $\langle f,f\rangle=0$, while $f\ne 0$.
When you restrict to polynomials, on the other hand, a polynomial of degree $n$ is completely determined by its values in $n+1$ points. So if a polynomial is zero on an interval, it is zero everywhere. That's why the product $\langle f,g\rangle=\int_a^b fg$ is indeed an inner product on the set of polynomials.