Particle density operator in Fetter and Walecka 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$.
 A: Let me try to show it step by step.
You know that in second quantisation you can write a 1-particle operator $\hat A = \sum_i^N \hat a(i) $ as
$$\hat A = \sum_i^N \hat a(i) = \sum_{rr'} \hat{c}^{\dagger}_r \langle r |\hat a|r'\rangle\hat{c}_{r'}$$
so $$ \hat n(\mathbf{x})= \sum_{rr'} \hat{c}^{\dagger}_r \langle r |\delta_3(\mathbf{x}-\hat{\mathbf{x}})|r'\rangle\hat{c}_{r'}$$
If you choose the base $|\mathbf{x}\rangle$ you need to switch to the integral and the field operators:
$$ \int\mathrm{d}^3x'\mathrm{d}^3x''\,\hat{\psi}^{\dagger}(\mathbf{x}')\langle \mathbf{x}'|\delta_3(\mathbf{x}-\hat{\mathbf{x}})|\mathbf{x}''\rangle \hat{\psi}(\mathbf{x}'')
$$
Now let's focus on the matrix element: you need to apply the delta to the ket, getting $ \delta_3(\mathbf{x}-\mathbf{x}'') $, then you do the internal product, getting a $ \delta_3(\mathbf{x}'-\mathbf{x}'') $. Now using the properties of the deltas you get to the final result
$$\hat{n}(\mathbf{x}) = \hat{\psi}^{\dagger}(\mathbf{x})\hat{\psi}(\mathbf{x})$$
