Recall in discrete case, any operator A^ has a matrix representation.
Discrete matrix representation
A^=m,n∑∣m⟩⟨m∣A^∣n⟩⟨n∣=n,m∑Amn∣m⟩⟨n∣
∣ϕ⟩=A^∣ψ⟩⇒ϕm=n∑Amnψn
Continuous matrix representation
∣ϕ⟩=A^∣ψ⟩
\Rightarrow \phi(x)=\braket{x|\phi}=\bra{x}\hat{A}\ket{\psi}=A(x,y)
=\int\bra{x}\hat{A}\ket{y}\braket{y|\psi}dy
=\int A(x,y)\psi(y)dy
=\int\phi^*(x)\psi (x)~(dx)