In Fermionic Path Integral and Topological Phases, Witten shows that in $2+1$ dimensions, the free massless Dirac fermion suffers from parity anomaly. To be specific, he shows that it is impossible to quantize the theory that preserves the classical parity symmetry and maintain gauge invariance simultaneously.
To begin with, let $D_{\mu}=\partial_{\mu}+iA_{\mu}$, where $A$ is some $U(1)$ background gauge field. Let $\left\{\eta_{\mu\nu}\right\}=\mathrm{diag}(+1,-1,-1)$ be the spacetime metric. The Lagrangian of the Dirac fermion is given by
$$S[\bar{\psi},\psi;A]=\int d^{3}x\bar{\psi}iD\!\!\! /\,\psi.$$
Classically, this theory is gauge invariant under
$$A\rightarrow A+d\Lambda,$$ $$\bar{\psi}\rightarrow \bar{\psi}e^{i\Lambda},\quad\psi\rightarrow\psi e^{-i\Lambda},$$
and is invariant under a discrete parity ($\mathbb{Z}_{2}$) symmetry, which sends $(t,x,y)$ to $(t,x,-y)$, and
$$A_{0}(t,x,y)\rightarrow A^{\mathrm{P}}_{0}(t,x,y)=A_{0}(t,x,-y),$$ $$A_{1}(t,x,y)\rightarrow A^{\mathrm{P}}_{1}(t,x,y)=A_{1}(t,x,-y),$$ $$A_{2}(t,x,y)\rightarrow A^{\mathrm{P}}_{2}(t,x,y)=-A_{2}(t,x,-y),$$ $$\psi(t,x,y)\rightarrow\psi^{\mathrm{P}}(t,x,y)=\gamma^{2}\psi(t,x,-y),$$ $$\bar{\psi}(t,x,y)\rightarrow\bar{\psi}^{\mathrm{P}}(t,x,y)=\bar{\psi}(t,x,-y)\gamma^{2},$$
where $\gamma^{0}=\bigg( \begin{matrix} 1&0\\0&-1 \end{matrix} \bigg)$, $\gamma^{1}=\bigg( \begin{matrix} 0&i\\i&0 \end{matrix} \bigg)$, $\gamma^{2}=\bigg( \begin{matrix} 0&1\\-1&0 \end{matrix} \bigg)$.
Thus, under this $\mathbb{Z}_{2}$ transformation, one has
$$\int dt\int dx\int_{-\infty}^{+\infty}dy\bar{\psi}iD\!\!\! /\,\psi$$ $$\rightarrow\int dt\int dx\int_{+\infty}^{-\infty}d(-y)\bar{\psi}(t,x,-y)\gamma^{2}(i\gamma^{0}D_{0}+i\gamma^{1}D_{1}+i\gamma^{2}\partial_{2}+\gamma^{2}A_{2})\gamma^{2}\psi(t,x,-y)$$
where $\partial_{2}=\frac{\partial}{\partial y}$.
Thus one has,
$$\int dt\int dx\int_{-\infty}^{+\infty}dy\bar{\psi}iD\!\!\! /\,\psi$$ $$\rightarrow\int dt\int dx\int_{-\infty}^{+\infty}dy\bar{\psi}(t,x,-y)(i\gamma^{0}D_{0}+i\gamma^{1}D_{1}-i\gamma^{2}\partial_{2}-\gamma^{2}A_{2})\psi(t,x,-y)$$ $$=\int dt\int dx\int_{-\infty}^{+\infty}dy\bar{\psi}(t,x,-y)(i\gamma^{0}D_{0}+i\gamma^{1}D_{1}+i\gamma^{2}\partial_{-y}-\gamma^{2}A_{2})\psi(t,x,-y)$$ $$=\int dt\int dx\int_{-\infty}^{+\infty}dy\bar{\psi}(t,x,-y)(i\gamma^{0}D_{0}+i\gamma^{1}D_{1}+i\gamma^{2}(\partial_{-y}+iA_{2}))\psi(t,x,-y)$$
Replacing $-y$ by $y$ in the integral, one has
$$\int dt\int dx\int_{-\infty}^{+\infty}dy\bar{\psi}iD\!\!\! /\,\psi$$ $$\rightarrow\int dt\int dx\int_{-\infty}^{+\infty}dy\bar{\psi}(t,x,-y)(i\gamma^{0}D_{0}+i\gamma^{1}D_{1}+i\gamma^{2}(\partial_{-y}+iA_{2}))\psi(t,x,-y)$$ $$=\int dt\int dx\int_{+\infty}^{-\infty}d(-y)\bar{\psi}(t,x,-y)(i\gamma^{0}D_{0}+i\gamma^{1}D_{1}+i\gamma^{2}(\partial_{-y}+iA_{2}))\psi(t,x,-y)$$ $$=\int dt\int dx\int_{-\infty}^{+\infty}d(y)\bar{\psi}(t,x,y)(i\gamma^{0}D_{0}+i\gamma^{1}D_{1}+i\gamma^{2}(\partial_{y}+iA_{2}))\psi(t,x,y)$$ $$=\int dt\int dx\int_{-\infty}^{+\infty}dy\bar{\psi}iD\!\!\! /\,\psi$$
This proves that it has a classical $\mathbb{Z}_{2}$ symmetry.
However, in the path integral quantization, one has a problem to determine the sign of the partition function. Formally, the partition function is given by the infinite product of all eigenvalues of the Dirac operator $iD\!\!\! /\,$, i.e.
$$Z[A]=\int\mathcal{D}{\psi}\int\mathcal{D}{\bar{\psi}}\exp\left(i\int d^{3}x\bar{\psi}iD\!\!\!/\,\psi\right)$$ $$=\mathrm{Det}(iD\!\!\! /\,)=\prod_{k}\lambda_{k},$$
where $iD\!\!\!/\,\psi_{k}=\lambda_{k}\psi_{k}$. Since the Dirac operator is Hermitian, each eigenvalue $\lambda_{k}$ is real. Since there are infnitely many positive and negative eigenvalues, one encounters a sign ambiguity of the partition function. Picking up an arbitrary gauge field $A_{0}$, one can consider a gauge transformation that sends $A_{0}$ to $A_{0}^{\Phi}$. For $s\in[0,1]$, one can construct an interpolating gauge field $A_{s}$
$$A_{s}=(1-s)A_{0}+sA_{0}^{\Phi}.$$
If the theory is gauge invariant, one should expect that the spectrum of the Dirac operator at $s=0$ is the same as at $s=1$ since the two are gauge equivalent.
Between $s=0$ and $s=1$, there can be spectral flow of Dirac operator in which some negative eigenvalues may flow through $\lambda=0$ to positve spectrum.
Then, Witten uses a Pauli-Villars regularization, adding to the Lagrangian a ghost field
$$\mathcal{L}_{\mathrm reg}=\bar{\chi}iD\!\!\!/\,\chi+iM\bar{\chi}\chi$$
of large mass $M\rightarrow\infty$.
Question 0: What is the purpose of the factor $i$ for the mass term? Why cannot I use real mass $M\bar{\chi}\chi$ for the Pauli-Villars regulator?
Then, following the usual computation in Anomalies and Odd Dimensions and Nakahara 13.6.1, one finds that the regularized partition function is
$$Z[A]=|Z[A]|\exp\left(-i\pi\frac{\eta(A)}{2}\right),$$
where $\eta(A)$ is the APS eta-invariant of $A$, which roughly speaking is the number of positive eigenvalues of $A$ minus the number of negative eigenvalues of $A$. The Pauli-Villars regulator breaks the classical parity invariance, and so there is a parity anomaly for massless Dirac fermions in $2+1$ dimensions.
Witten then claims that this partition function (equation 2.20 in the paper) is satisfactorily defined for all $A$. I guess what he means is that the regularized partition function is gauge invariant. However, I don't see any reason why this regularized partition function is gauge invariant and is well-defined. For example, consider the case when an eigenvalue, say $\lambda$, flows from negative to positive under a gauge transformation. Once it flows through $\lambda=0$, the value of $\eta(A)$ jumps by $\pm 2$, and so the partition changes a sign. Such a sign change is smooth if and only if the complex number
$$|Z[A]|\exp\left(-i\pi\frac{\eta(A)}{2}\right)$$
traces a smooth path through $z=0$ on the complex plane $\mathbb{C}$. Only when the partition function is smooth can one define correlation functions.
Question 1: How do I know that there cannot exist situations like $|z|$ or $\sqrt{z^{2}}$?
Question 2: How do I see that the spectrum at $A_{0}$ is the same as at $A_{0}^{\Phi}$ from the expression of the regularized partition function?