Inner product of infinite dimensions I want to know the reason why we can use integral for inner product in infinite dimensional space.
i.e.: Why the innerproduct, which in finite dimension is $\sum_{i}f(x_{i})g(x_{i})$, in infinite dimension is defined as $$\int_{a}^{b} f(x)g(x) dx.$$ 
What is the mathematical reason to turn summation into integral for infinite dimension? Simply saying how can summation be turned into an integral as clearly that summation is not in the form of Riemann sums i.e. \begin{align*}
R(n) &= f(x_1)\Delta x + f(x_2)\Delta x + \cdots + f(x_n)\Delta x\\
&= \sum_{i=1}^n f(x_i)\Delta x.\end{align*}
PS. I know it satisfies all axioms where as normal summation does not, but I am looking for a mathematical reason of why a sum which is not in form of Riemann sums can be rewritten as an integral. Also I know similar questions have been posted but none have answers which gives proper mathematical reason, which is why I am asking this. Any help is appreciated.
 A: There are two answers to your question. One concerning inner products and one more specific to your question about Riemann sums.
First it should be noted that the inner product is an abstract definition. You do not need to define it in the terms of a sum or an integral. All you need is a function $\langle\cdot,\cdot\rangle:X\times X\rightarrow\mathbb{R}$ on a vector space $X$ which is symmetric, positive definite and positive definite. (See https://en.wikipedia.org/wiki/Inner_product_space.)  For example, one can use the trace to define an inner product on the vector space of real $n\times n$ matrices by
$$\langle A,B\rangle=\text{trace}(A^{T}B)\qquad A,B\in M_{n\times n}(\mathbb{R}).$$
Moreover, in infinite dimension there are inner products which are infinite sums like sequence spaces. (See https://en.wikipedia.org/wiki/Sequence_space.)
However to perhaps answer your question more specifically we have to turn to measure theory. I will not dive into this to deeply, as I presume that you have not seen measure theory yet, but measure theory is a way to generalise the Riemann integral.
What happens in a Riemann sum is that we approach the integral by looking at step functions (functions which are constant on intervals). To get an approximation we multiply these constant function values with the weight, or measure of the intervals, yielding us the Riemann sum
$$R(n)=f(x_{1})\cdot(x_{1}-x_{0})+...+f(x_{n})\cdot(x_{n}-x_{n-1}).$$
Note that the measure of the interval is simply the length, this measure is known as the Borel measure.
One can define other measures though, and we can actually write a sum as an integral using measures. Suppose we are interested in the sum
$$\sum^{n}_{i=1}f(i)$$
where $f:\{1,...,n\}\rightarrow\mathbb{R}$ we can define a measure on $\mathcal{P}(\{1,...,n\})$ by defining $\mu(X)=|X|$ for $X\in\mathcal{P}(\{1,...,n\})$, i.e. the measure of a set is the cardinality. Then using measure theory we can write the sum as follows:
$$\sum^{n}_{i=1}f(i)=\int_{\{1,...,n\}}f(i)\ d\mu(i)=\sum^{n}_{i=1}f(i)\mu(\{i\})=\sum^{n}_{i=1}f(i).$$
This is some motivation, why we switch from a sum to integrals. Basically all we do is use a different measure.
If you are interested in this I would highly recommend following a course in Measure theory, more basic information can be found here: https://en.wikipedia.org/wiki/Measure_(mathematics).
A: You're probably more familiar with $\sum_i f_ig_i$ for vectors $f,\,g$ in a vector space of countable dimension, so iterating over a dummy variable $i$ gives the entries of $f,\,g$. In a space whose dimension is equal to the cardinality of $[a,\,b]$ with $\Bbb R\owns a<b\in\Bbb R$ - this is an uncountable cardinality variously denoted $2^{\aleph_0}$, $c$ or $\beth_1$ - we can't sum. One example of such a space is the space of functions on $[a,\,b]$. Such functions have one value at each $x\in[a,\,b]$, so the argument $x$ plays the role of $i$ in $\sum_i$ above. So in this continual limit, functions are literally vectors (albeit in a space of uncountable dimension), summation becomes integration as per the formula you asked about, and you can verify this definition meets the inner product axioms. (Well, if the functions are complex we need to change $f$ to $f^\ast g$ for sesquilinearity.)
