Explanation of $\sum_n\langle\psi_n(x)|(O\psi_n)(x)\rangle=:(\mathrm{tr}\,O)(x)=\mathrm{tr}\int\frac{\mathrm{d}k}{(2\pi)^4}e^{ikx}Oe^{-ikx}$ Let $D$ be the Dirac operator, $O_N:=e^{-(D/N)^2}$ for $N\in\mathbf{N}$ and $\{\psi_n\}$ a complete set of eigenfunctions of $D$.
On page $69$ and $78$ of Path Integrals and
Quantum Anomalies and in the paper Path Integral for Gauge Theories with Fermions, Fujikawa uses the equation
\begin{equation}\tag{1}
(\mathrm{tr}\,O_N)(x):=\sum_{n=1}^{\infty}\big\langle\psi_n(x)|(O_N\psi_n)(x)\big\rangle=\mathrm{tr}\int\frac{\mathrm{d}k}{(2\pi)^4}e^{ikx}O_Ne^{-ikx}
\end{equation}
to derive
\begin{equation}
\lim_{N\to\infty}(\mathrm{tr}\,O_N)(x)=-\frac{1}{8\pi^2}\mathrm{tr}(F_{ij}F_{kl})(x)\epsilon^{ijkl}.
\end{equation}
Unfortunately, I don't understand how the right hand side of $(1)$ is defined - however, he uses the relation
\begin{equation}
\nabla_\mu\mathrm{e}^{ikx}=\mathrm{e}^{ikx}(\nabla_\mu+ik_\mu)
\end{equation}
later on - since $\nabla_\mu(u\cdot\psi)=u\cdot(\nabla_\mu+ik_\mu)\psi$ if $u(x):=e^{ikx}$, this suggests that $Ae^{-ikx}$ is actually the operator $\psi\mapsto A(u\cdot\psi)$.
He also claims that $(1)$ is a "unitary transformation" from the basis $\{\psi_n\}$ to plane waves $\{e^{ikx}\}$, but this doesn't make sense to me - I think $\psi_n(x)\in\mathbf{C}^N\otimes \mathfrak{g}$, whereas $e^{ikx}\in\mathbf{C}$.
If you've seen similar equations somewhere else, please also let me know.
 A: You are probably confused because of the  muddled notation such as $|\psi(x)\rangle$. Indeed I remember being confused when I first read Fujikawa's account.   Let's do it with proper Dirac notation:
Firstly the  LHS
$$
\sum_n \langle \psi_n(x)|O(\psi_n(x)\rangle
$$
is to be interpreteted as
$$
\sum_n\langle \psi_n|x\rangle \langle x|\hat O|\psi_n\rangle
$$
where the $|\psi_n\rangle$ are any complete set of states and the $\langle x|\psi_n\rangle\equiv \psi_n(x)$ the corresponding wavefunctions. This is the usual definition of the functional trace ${\rm Tr} \{\hat O\}$ for a trace-class operator on $L^2[\mathbb R]^n\otimes {\mathcal  V}$ where ${\mathcal V}$ in the space of internal degrees of freedom such as group representation or spinor indices.
As the set is complete
$$
\sum_n |\psi_n\rangle \langle \psi_n|= {\rm Identity}
$$
we could also use as a  complete set the position eigenstates $|x\rangle$ write the trace  as
$$  
{\rm Tr} \{\hat O\} = {\rm tr} \int d^nx \langle x|\hat O|x\rangle
$$
where the trace with the lower case "t" is the trace only over the ${\mathcal V}$ internal indices, which are usually hidden. In more detail we would include those, so that the wavefinctions would be
$$
\psi_{n,i}(x)= \langle x,i|\psi\rangle
$$
where $i$ labels a basis for ${\mathcal V}$ and
$$
{\rm Tr}\{\hat O\}= \sum_i \int d^nx \langle i,x|\hat O|i,x\rangle 
$$
For the Dirac operator acting on sections of a gauge bundle the internal indices are  the spin labels $\alpha$ on which the gamma matrices act,  and labels "$i$" on which the group representation matrices $\lambda_a$ in the bundle-connection gauge field
$$
A_\mu= \lambda_a A^{(a)}_\mu 
$$
act.
We can of course use any complete set of eigenfunctions for the spatial part of the trace. For example $\langle x|k\rangle = e^{ikx}$.
As an illustration fo what Fujikawa doe with this, suppose we  wish to compute the quantum mechanics matrix element
$$
 \langle{x}|{e^{-tH(\hat p,\hat x)}}|{y}\rangle , \quad [\hat x, \hat p]=i.
$$
We use
$$
\langle{x}|{\hat p} |{\psi}\rangle = -i\partial_x \langle {x}|{\psi}\rangle, \quad \langle{x}|{\hat x}| {\psi}\rangle = x \langle{x}|{\psi}\rangle ,
$$
and
$$
\langle x|x'\rangle = \delta(x-x'), \quad \langle k|k'\rangle = 2\pi \delta(k-k'), \quad \langle x|k\rangle=e^{ikx},
$$
to proceed as follows
$$
\langle {x}|{e^{-tH(\hat p,\hat x)}}|{\psi}\rangle = e^{-tH(-i\partial_x , x)}\langle{x}|{\psi}\rangle,\\
=\int \frac {dk}{2\pi}e^{-tH(-i\partial_x , x)} \langle {x}|{k}\rangle  \langle {k}|{\psi}\rangle,\\
= \int \frac {dk}{2\pi}e^{-tH(-i\partial_x , x)} e^{ikx} \langle {k}|{\psi}\rangle,\\
= \int \frac {dk}{2\pi} e^{ikx}e^{-tH(-i\partial_x+k , x)}  \langle {k}|{\psi}\rangle,\\
= \int \frac {dk}{2\pi} e^{ikx}\langle{k}|{\psi}\rangle  e^{-tH(-i\partial_x+k , x)} 1.
$$
Now set $|{\psi}\rangle =|{y}\rangle $  so   $\langle k|\psi\rangle\to \langle {k}|{y}\rangle = e^{-iky}$ to get
$$
\langle {x}|{e^{-tH(\hat p,\hat x)}}|{y}\rangle = \int \frac {dk}{2\pi} e^{ik(x-y)}e^{-tH(-i\partial_x+k , x)}1
$$
where, when we expand out the exponential, the $\partial_x$ derivatives act on everything to their right  until they reach $\partial_x 1=0$.
To take the trace we set $x=y$ and integrate
$$
{\rm Tr}\{e^{-tH}\} =\sum_n e^{-t\lambda_n}= \int dx\left\{ \int  \frac {dk}{2\pi} e^{-tH(-i\partial_x+k , x)}1\right\}
$$
where the $\lambda_n$ are the eigenvalues of $H$.
To answer your question about $\langle x|\hat O| x\rangle$: If $\hat O$ has eigenvectors $|\psi_n\rangle$ then inserting two complete sets of states, we have
$$
\langle x|\hat O| x\rangle=\sum_{m,n} \langle x|\psi_n\rangle \langle \psi_n|\hat O|\psi_m\rangle\langle \psi_m|x\rangle\\
= \sum_{m,n} \lambda_m\langle x|\psi_n\rangle \langle \psi_n|\psi_m\rangle\langle \psi_m|x\rangle
= \sum_{m,n} \delta_{mn}\lambda_m\langle x|\psi_n\rangle \langle \psi_m|x\rangle\\
= \sum_m \lambda_m \psi_m^*(x) \psi_m(x).
$$
This assumes that the sum converges. Sometimes it does not, but the reason for Fujikawa  using heat kernels is that $\sum e^{-t\lambda_n}$ is very nicely behaved when the $\lambda_n$ are positive.
For example
$$
\langle x |e^{-t(-\partial_x^2)}|y \rangle = \frac 1{\sqrt{4\pi t}} \exp\{-(x-y)^2/4t\}
$$
so
$$
\langle x |e^{-t(-\partial_x^2)}|x \rangle= 
\frac 1{\sqrt{4\pi t}}
$$
which can also be obtained from the eigenvector $\langle x|k\rangle= e^{ikx}$  and  eigenvalues $k^2$ of $-\partial_x^2$ as
$$
\int \frac {dk}{2\pi} e^{-tk^2}=\frac 1{\sqrt{4\pi t}}
$$
A: Think of the $\psi$'s as being a some spinor $u\in\mathbb{C}^4$ of functions $f:\mathbb{R}^4\rightarrow \mathbb{C}$, which is again the space where the Lie algebra acts, not the Lie algebra itself. So think that
$$\psi(x)\propto e^{i k x} u_s $$
Now notice equation (1) still has a trace, which is the trace over possible remaining index $s$, in this case the spinor indices. While the functional part is taken care by the plane waves and as you might know computing an inner product can be done with the Fourier transform, namely momentum space instead of configuration space (spacetime points).
A: Let's assume $O$ acts on complex valued functions. We can improve the notation by setting $\langle x|\psi\rangle:=\psi(x)$, $\langle\psi|x\rangle:=\overline{\psi(x)}$ (complex conjugate) and $|n\rangle:=\psi_n$. We can obtain the result from the title by introducing the plane wave basis defined by $\langle x|k\rangle=\mathrm{e}^{\mathrm{i}kx}$ and using the Fourier inversion theorem:
\begin{align}
\sum_n \langle \psi_n(x)|(O\psi_n)(x)\rangle=\sum_n \overline{\psi_n(x)}(O\psi_n)(x)=\sum_n\langle n|x\rangle \langle x|O|n\rangle=\sum_n\int\frac{\mathrm{d}k}{(2\pi)^d}\langle n|k\rangle\langle k|x\rangle\langle x|O|n\rangle\\
    =\int\frac{\mathrm{d}k}{(2\pi)^d}\langle k|x\rangle\langle x|O\sum_n\langle n|k\rangle|n\rangle=\int\frac{\mathrm{d}k}{(2\pi)^d}\langle k|x\rangle\langle x|O|k\rangle=\int\frac{\mathrm{d}k}{(2\pi)^d}\mathrm{e}^{-\mathrm{i}kx}\langle x|O|k\rangle
\end{align}
Of course, writing $\langle x|O|k\rangle=O\langle x|k\rangle$ is simply wrong.
