In Fetter and Walecka page 20 they say in order to find the second quantized operator $\hat{J}$ of the first quantized one body operator $J$ you need to calculate $$\hat{J} = \int\mathrm{d}^3x\,\hat{\psi}^{\dagger}(\mathbf{x}) J(\mathbf{x}) \hat{\psi}(\mathbf{x}) $$ where $\hat{\psi}^{(\dagger)}$ are the field operators.
They then define the number density operator $n(\mathbf{x}) = \sum_{i=1}^N \delta(\mathbf{x}-\mathbf{x}_i)$. Now it's not stated what $\mathbf{x}_i$ is but presumably it's the location of the $i$th particle. Does this statement even make sense in QM/QFT? Since a particle/wavefunction doesn't have a well defined position, how do you define $\mathbf{x}_i$? Is it the expectation value $\langle \psi | \mathbf{\hat{x}}|\psi\rangle$?
My main question is about the second quantised form however. They clearly state that $\mathbf{x}$ is the argument of n, but then compute $$\hat{n}(\mathbf{x}) = \hat{\psi}^{\dagger}(\mathbf{x})\hat{\psi}(\mathbf{x})$$ How does integrating over the delta functions yield $\mathbf{x}$? I would think that the 2nd quantised form should be \begin{align*} \hat{n}(\mathbf{x}) &= \int\mathrm{d}^3x\, \hat{\psi}^{\dagger}(\mathbf{x}) n(\mathbf{x})\hat{\psi}(\mathbf{x}) = \sum_{i=1}^N \int\mathrm{d}^3x\,\hat{\psi}^{\dagger}(\mathbf{x})\hat{\psi}(\mathbf{x})\delta(\mathbf{x}-\mathbf{x}_i) \\ &= \sum_{i=1}^N \hat{\psi}^{\dagger}(\mathbf{x}_i) \hat{\psi}(\mathbf{x}_i) \end{align*}
I don't understand why in this answer they simply replace $\mathbf{x}_\alpha$ by the integration variable instead of replacing $\mathbf{x}$ which is the variable of $n$.