Shankar p68-69 gives a mathematical "derivation" of the action of the X (position) operator, the summary of which is as follows:

I followed the logic without a problem, since it only involves using the matrix elements of X in the basis of eigenfunctions of X. However, the next paragraph reads:

Similarly, he writes, of the action of X in the K basis

Now, to me

[tex]f(x) = \left\langle x | f \right\rangle[/tex]

and

[tex]g(k) = \left\langle k | g \right\rangle[/tex]

are scalars. Hence I cannot comprehend what is intended by Shankar's notation. Any insight?

which is what leads him to write that [tex]\textbf{X} \left| g(k) \right\rangle = \left|i\frac{dg(k)}{dk}\right\rangle[/tex].

The notation [tex]|f(x)\rangle[/tex] as the ket corresponding to f(x) (which he says near the top of pg. 69) is sloppy, but I don't think there is anything wrong with it. He's not saying that [tex]|k\rangle \propto e^{ikx}[/tex], he's just using it as a notation to express the ket that comes out of the operation [tex]X|f\rangle[/tex].