Shankar's Principles of Quantum Mechanics, pg. 57-59 subsection Generalisation to Infinite Dimensions states that state vectors defined as,
$$|f_n\rangle = \sum_{i} f_n(x_i) |x_i\rangle, \tag{1}$$
exist within a space of dimension $n$ which is 'unspecified but assumed to be some finite number'. The text then goes on to say that for $n\rightarrow\infty$ the series must be replaced with an integral such that the inner product remains finite, i.e.
$$\langle f|f\rangle = \int |f(x)|^2 dx.$$
What I'm trying to understand is when one can let $n\rightarrow\infty$ without assuming one has a continuous basis, i.e. that the $x_i$ remain distinct and the series description (1) is still valid. The inner product,
$$\langle f|f\rangle = \sum_i^\inf |f(x_i)|^2,$$
must be finite which restricts $f$, so does this just define some restricted function space? How does all this link in with the notion of countably infinite and uncountably infinite Hilbert spaces?