I'm reading the 3rd edition of Sakurai and Napolitano's Modern Quantum Mechanics, which (probably rightly) relegates wave mechanics to an appendix. Instead, it carefully develops Dirac's formalism, and uses it to expose quantum mechanics. Because notation is at the heart of this exposition, I want to be sure I get it exactly right.
The authors note that the usual wave function corresponding to a state $\left|\alpha\right>$ in the position basis is given by $\psi_{\alpha}(x') = \langle x' | \alpha\rangle$, and that, given two kets $\left|\alpha\right>$ and $\left|\beta\right>$, the expectation value of some operator depending on position $f(x)$ is given by
\begin{equation*} \left<\beta\right|f(x)\left|\alpha\right> = \int{\mathrm{d}x'\,\langle \beta |x'\rangle f(x')\langle x' | \alpha\rangle} = \int{\mathrm{d}x'\,\psi^{\ast}_{\beta}(x')f(x')\psi_{\alpha}(x')}. \end{equation*}
Later, the familiar problem of the infinite square potential well is treated as an exercise, and the usual wave functions are
\begin{equation*} \psi_{n}(x') = \langle x | n\rangle = \sqrt{\frac{2}{a}}\sin{\left(\frac{n\pi}{a}x'\right)}. \end{equation*}
Now suppose I want to calculate $\left<x\right>$. I know the way to calculate it is
\begin{equation*} \left<x\right> = \int{\mathrm{d}x'\psi^{\ast}_{n}(x')x'\psi_{n}(x')}, \end{equation*}
but by the notation developed earlier, we should be able to write
\begin{equation*} \left<x\right> = \left<\beta\right|x\left|\alpha\right>. \end{equation*}
Here (at long last) is my question: in this case, what are the kets $\left|\alpha\right>$ and $\left|\beta\right>$? Do I have a tragic misunderstanding of the notation?
Edit: the authors denote the inner product of $\left|\alpha\right>$ and $\left|\beta\right>$ as $\langle \alpha | \beta\rangle$. Therefore, in writing $\langle x' | n\rangle$, they seem to suggest the existence of two kets $\left|x'\right>$ and $\left|n\right>$. Maybe my confusion is here.
Here is an excerpt from the text: