I'm having some trouble with understanding the derivation of the action of the $X$ operator. It seems to be a result of the notation used and not a property of itself.
The usual argument is to consider eigenfunctions of the $X$-operator: $X|x\rangle = x|x\rangle$ where $X$ is an operator, $|x\rangle$ is an eigenket of $X$ and $x$ is the corresponding eigenvalue. Then \begin{eqnarray*} \color{red}{\langle x'|}X|x\rangle &=& \color{red}{\langle x'|}x|x\rangle \\ \\ \langle x'|X|x\rangle &=& x\langle x'|x\rangle \\ \\ \langle x'|X|x\rangle &=& x\,\delta(x'-x) \end{eqnarray*} where $\delta$ is Dirac's $\delta$-"function". Then we ask what $X$ does to arbitrary kets like $|f\rangle$: \begin{eqnarray*} (Xf)(x) &=& \langle x | X | f\rangle \\ \\ &=&\int_{-\infty}^{+\infty} \langle x|X|x'\rangle\langle x'|f\rangle~\mathrm dx' \\ \\ &=& \int_{-\infty}^{+\infty}f(x')\color{red}{\langle x|X|x'\rangle}~\mathrm dx' \\ \\ &=& \int_{-\infty}^{+\infty} f(x')\,\color{red}{x'\,\delta(x-x')}~\mathrm dx' \end{eqnarray*} The defining property of the $\delta$-"function" is that $\int_{\mathbb R} f(y)\,\delta(x-y)~\mathrm dy=f(x)$, and so $$(Xf)(x) = x\,f(x)$$
However, if I do this with other symbols, then I can't get the same result. Let's say $X|x\rangle = \lambda |x\rangle$. Then following the same steps gives $\langle x'|X|x\rangle = \lambda \langle x'|x\rangle=\lambda \,\delta(x'-x)$, and whence $$(Xf)(x)=\lambda f(x)$$ This is to be expected: $Xf$ is just an eigenvalue multiple of $f$.
It seems that the property that $X : f \mapsto xf$ comes from the fact that we used $x$ to denote the eigenvalue of $X$. What am I missing here?
Perhaps because $x$ is a real number and the set of all kets $|x\rangle$ can be identified with the real line by $|x\rangle \mapsto x$, and that $x$ must be an eigenvalue of $|x\rangle$ under this construction?