Correspondence between wave function and state vector I am confused with connection between state $| \psi \rangle$ of a quantum system and corresponding wave function $\psi(x)$ (at a given time). I have been told that for every state $| \psi \rangle$ we can define $\psi(x) \equiv \langle x | \psi \rangle$, where $|x\rangle$ are eigenkets of position operator. So basicaly wave function is continuous coefficient in the expansion of $| \psi \rangle$ in the basis eigenkets $| x \rangle$, right? But this can be true for any state of the system only if the state space of the system is a subspace of the space spanned by position eigenkets $| x \rangle$, right? Moreover this has to be true for every quantum system. How is this possible?
 A: The identification that $ ψ(x)≡⟨x|ψ⟩$ is completely correct, and this is the way to treat wavefunctions in 'grown-up' quantum mechanics. In short,


*

*So basicaly wave function is continuous coefficient in the expansion of $|ψ⟩$ in the basis eigenkets $|x⟩$, right?


Yes, and


*

*But this can be true for any state of the system only if the state space of the system is a subspace of the space spanned by position eigenkets $|x⟩$, right?


yes.

How is this possible?

The position is an observable and all observables have orthonormal bases which span the Hilbert space. More generally, the fact that the eigenkets $| x \rangle$ span the Hilbert space simply tells you that all particles must be somewhere. Mathematically, it says that there does not exist any physical state $| \psi \rangle$ such that $\langle x |\psi \rangle=0$ for all $x$, which is precisely the statement that every physical state must be located at some position (or possibly several).
There's nothing really mysterious about this.

Edit, in response to your comment:

Thank you for your answer! I just don't fully understand how those position eigenkets span, say, $n$-dimensional state space $\mathcal H$ of the system. It looks like for such system there has to be set of only $n$ independent position ket states which are capable of spanning the $\mathcal H$, but this makes no sense to me. What would these "special" position kets represent? Clearly I am doing something wrong.

There are two distinct confusions here. First of all, the state space $\mathcal H$  of the system is in general not infinite dimensional. As such, there aren't any finite number of position kets $| x \rangle$ which span the whole space; instead, you need to sum over a whole continuum, and indeed over all real $x$:
$$
| \psi \rangle=\int_{-\infty}^\infty \text d x |x\rangle\langle x | \psi \rangle.
\tag1
$$
Secondly, some systems can indeed be described well using a finite dimension. When this happens, there exists a set of states $\{| \psi_1 \rangle, \ldots,| \psi_n \rangle\}\subset\mathcal H$ whose span $\mathcal H_0$ contains (most of) the system's evolution. In this case, $\mathcal H_0$ is still contained within $\mathcal H$, so all the states in it can still be expressed as an infinite sum over position kets as in (1). By going to finite dimension, what you lose is the ability to express a position ket $| x \rangle$ in terms of a basis of your subspace, not the other way around.
