Shyan said:
[itex]
\frac{\hbar}{i} \frac{\partial}{\partial x}(e^{ikx})=\frac{\hbar}{i}ik e^{ikx}=\hbar k e^{ikx} \Rightarrow Pe^{ikx}=\hbar k e^{ikx}[/itex]
Right, this shows that ##e^{ikx}## is an eigenfunction of ##-i\hbar\, d/dx##. However, a state vector is a member of the system's Hilbert space, and the Hilbert space in this case is defined in the following (rather complicated) way. Let V be the set of square integrable functions from ℝ into ℂ. For all f,g in V, define f+g by (f+g)(x)=f(x)+g(x) for all x. For all f in V and all c in ℂ, define cf by (cf)(x)=c(f(x)) for all x. This turns V into a vector space. Now define, for all f,g in V, ##\langle f,g\rangle=\int f(x)^*g(x) dx##. The map ##(f,g)\mapsto\langle f,g\rangle## is a semi-inner product on V. So we have turned V into a semi-inner product space. The reason why I call this a semi-inner product rather than an inner product is that <f,f>=0 doesn't imply f=0. For example, if f is the function such that f(1)=1 and f(x)=0 for all x≠0, then we have f≠0 and <f,f>=0. To proceed we define f and g to be
equivalent if ##\langle f-g,f-g\rangle=0##. Let's use the notation [f] for the set of members of V that are equivalent to f. [f] is called an equivalence class. Each f in G belongs to exactly one equivalence class. So now we define ##L^2(\mathbb R)## as the set of all equivalence classes. To turn this into a vector space, we define [f]+[g]=[f+g] and c[f]=[cf]. (It's not obvious that these definitions make sense, but it's not too hard to show that they do). Now we can finally define an inner product by ##\langle[f],[g]\rangle=\langle f,g\rangle##. This turns ##L^2(\mathbb R)## into an inner product space, and that inner product happens to be a Hilbert space. This is proved in books on functional analysis (or integration theory).
So where does ##e^{ikx}## fit into all of this? It's not a member of ##L^2(\mathbb R)## or a member of V. It's a member of a larger vector space that has V as a subspace. The operator ##-i\hbar\, d/dx## has eigenfunctions in that larger space, but not in V. A state vector is a member of ##L^2(\mathbb R)##, i.e. it's an equivalence class of members of V. A wavefunction is a member of V. ##e^{ikx}## isn't even that.
I like to write George Jones's calculation like this: Suppose that [A,B]=cI, where I is the identity operator and c is a complex number.
\begin{align}1 =\frac 1 c \langle a| cI|a\rangle =\frac 1 c \langle a|[A,B]|a\rangle =\frac 1 c \big(\langle a|AB|a\rangle - \langle a|BA|a\rangle\big) =\frac 1 c\big(a^*\langle a|B|a\rangle-a\langle a|B|a\rangle\big)=0.
\end{align} I used that
a is real in the last step.