Hamel basis of an infinite dimensional space I couldn't grasp the concept in Kreyszig's "Introductory Functional Analysis with Applications" book that every vector space $X\neq\{0\}$ has a basis.
Before that it's said that if $X$ is any vector space, not necessarily finite dimensional, and $B$ is a linearly independent subset of $X$ which spans $X$, then $B$ is called a basis (or Hamel basis) for $X$. Hence if $B$ is a basis for $X$, then every nonzero $x\in X$ has a unique representation as a linear combination of (finitely many!) elements of $B$ with nonzero scalars as coefficients.
How can any infinite dimensional space has a finite basis?
 A: If $X$ is an infinite-dimensional vector space over some field $F,$ then any basis $B$ must be an infinite set.
It's true that any $v\in X$ can be written as a finite linear combination $p_1 b_1 +\dots + p_n b_n,$ where the $p_k$ are in the underlying field $F$ and the $b_k$ are in the basis $B.$
This doesn't say that $B$ is finite though. Different $v$ in $X$ will require different basis elements to write them in the above format — only finitely many basis elements for any particular $v,$ but (assuming that $X$ is infinite-dimensional so that $B$ is infinite) as you let $v$ vary, you're going to need the infinitely many basis elements to write the various linear combinations (even though each linear combination is itself, individually, a finite sum).

Here's an example:
Let $X$ be the set of all infinite sequences of real numbers that are eventually $0;$ in other words, a member of $X$ is a function $f\colon\mathbb{N}\to\mathbb{R}$ such that for some $n\in\mathbb{N}$, for all $k\gt n,$ $f(k)=0.$  Of course, $X$ is a vector space over $\mathbb{R}$ under pointwise addition and pointwise scalar multiplication.
For each $n\in\mathbb{N},$ let $b_n\in X$ be defined by setting $$b_n(k)=\begin{cases}1,\text{ if }k=n,\\0,\text{ if }k\ne n.\end{cases}$$
Then you can see that $\{b_n\mid n\in\mathbb{N}\}$ is a basis for $X$ over $\mathbb{R}.$ Any member of $X$ can be written as a finite linear combination of the $b_n\text{'s}$ (since each member of $X$ is eventually $0).$ But you need all the $b_n\text{'s}$ (infinitely many) to write all the members of $X$ in that way.

[By the way, the theorem that every vector space has a basis uses the axiom of choice, as does the theorem that any two bases for the same vector space must have the same cardinality. Without the axiom of choice, there can be vector spaces without a basis, and also vector spaces which have a basis but which don't have a well-defined dimension, because different bases can have different cardinalities. I wouldn't worry about any of this when you're just starting to study vector spaces though.]

A: The answer is simple: it has a basis, but not a finite basis. The general definition of a basis is that any vector is a linear combination of a finite number of elements of the basis, in a unique way.
For instance, for any field $K$, the ring of polynomials $K[X]$ is a $K$-vector space. Its usual (countable) basis is the set of monomials:
$$\{1,X, X^2, \dots, X^n,\dots\}.$$
One proves every vector space over a field $K$ has a basis. The proof requires the axiom of choice.
In particular $\mathbf R$ is a $\mathbf Q$-vector space, and as such, it has  bases over $\mathbf Q$. We know a Hamel basis  for $\mathbf R$ has to be uncountable since $\mathbf R$ is, but no one ever saw one explicitly.
