is inner product only valid for euclidean space $\mathbb R^n$?
I mean, basic idea of inner product is that product of two elements in vector is real or complex.
So, if it is valid for other vector spaces such as polynomials, it does not seem like it works
Inner product is a bilinear funtion defined as here.
One interesting example as you mentioned is when $V=C^{0}([a,b])$, the vector space whose elements are continuous functions $g,f:[a,b] \rightarrow \mathbb{R}$. As an exercise you could show that
$$ \langle f,g \rangle = \int_{a}^{b} \ f(x)g(x)\ dx$$ is an inner product. In this case, the norm of the function $f$ is given by
$$|f| = \sqrt{\int_{a}^{b} \ f(x)^{2}\ dx}$$
This inner product is used in Fourier Series.