If we have the complex scalar $\langle f|\Omega|g\rangle$ as in equation (2.73) of these course notes (where $\Omega$ is Hermitian), and want to evaluate it in the position basis, I would proceed as follows:
$\langle f|\Omega|g\rangle =\iint dx \ dy\langle f|y\rangle \langle y|\Omega|x\rangle \langle x|g\rangle =\iint dx \ dy \ (f(y))^{*}g(x)\langle y|\Omega|x\rangle \quad \quad \mathbf{(1)} $
However, said notes claim that
$\langle f|\Omega|g\rangle=\int dx \ (\Omega f(x))^{*}\ g(x)=\int dx \ (f(x))^{*}\Omega \ g(x) \quad \quad \mathbf{(2)}$
which I don't understand. I'm okay with the first equality in $\mathbf{(2)}$, but have an issue with the second one. $(\Omega f(x))^{*}$ is really $\langle \Omega f | x\rangle=(\langle x|\Omega|f\rangle)^{\dagger}$, so I don't see how the $\Omega$ can just be plucked out.
Context:
I want to evaluate the expectation $\langle \hat{O}\rangle_{\psi}$ of observable $\hat{O}$ using the position basis. By my usual approach in $\mathbf{(1)}$, $\langle \psi| \hat{O} | \psi \rangle=\iint dx\ dy \ (\psi(y))^{*}\psi(x)\langle y|\hat{O}|x\rangle$ but if this can be whittled down to $\langle \psi| \hat{O} | \psi \rangle=\int dx \ \|\psi(x)\|^{2}\langle x|\hat{O}|x\rangle$ then I'd like to know if that is indeed possible! I was trying to follow part 2 of Valerio's answer here.