Given that a classical phase space quantity $A_{cl}(x, p_{x})$ is related to the quantum operator $\hat{A}$ in Hilbert space as
$ A_{cl} = e^{-ik_{x}x} \langle x|\hat{A}|k_{x}\rangle = \langle x|\hat{A}|k_{x}\rangle \langle k_{x}|x\rangle $
By integrating over phase space one obtains the following expression: $ \int dx \int \frac{dp}{2\pi\hbar} A_{cl}(x,p_{x}) = \int dx \langle x|\hat{A}|x\rangle = Tr( \hat{A}) $
However, it is not clear to me how the Hilbert space operator can now be expressed via the following expression: $ \hat{A} = \int dx \int \frac{dp}{2\pi\hbar} |x\rangle \langle x|\hat{A}|k_{x}\rangle \langle k_{x}| $
This can be shown by noting that $$ \hat{A} = \operatorname{id} \hat A \operatorname{id} =\left(\int dx\, |x\rangle \langle x|\right) \hat{A}\left(\int \frac{dp}{2\pi\hbar} |k_{x}\rangle \langle k_{x}|\right) $$