Why is the path integral nonzero in quantum field theory? In QFT we are generally interested in the generating functional $\mathcal Z [J] = \langle0,t_f|0,t_i\rangle = \int\mathcal D\phi e^{iS[\phi,j]}.$ This means that our boundary conditions must be $$\phi(x,t_i) = \varphi_0(x,t_i), \phi(x,t_f) = \varphi_0(x,t_f),$$ where $\varphi_0$ is the vacuum state field configuration. Now, we usually set $t_i =-T, t_f = T$ and take the limit $T\to \infty$, giving $$\lim_{T\to \infty}\int_{\varphi _0(x,-T)}^{\varphi_0(x, T)}\mathcal D\phi e^{iS[\phi,J]} =\mathcal Z[J].$$ From the definition of the path integral measure$$\mathcal D \phi=\prod_{(x,t)}d\phi(x,t),$$ we would have $$\lim_{T\to \infty}\int_{\varphi _0(x,-T)}^{\varphi_0(x, T)}\prod_{(x,t)}d\phi(x,t)e^{iS[\phi,J]}.$$ One part of this integral would be $\lim_{t\to \infty}\int_{\varphi_0(x, -T)}^{\varphi_0(x,T)}d\phi(x,t)e^{iS[\phi,J]},$ but if the vacuum is time translation invariant, then $\varphi_0(x,t_i) =\varphi_0(x, t_f)$ for all $t_i, t_f$. So, why doesn't the above integral vanish? More generally, how do we implement boundary conditions in the path integral?
 A: I think you are confused that the upper and lower limits of the integral are the same, so it must be zero. Think about non-relativistic QM, does the amplitude for a particle to transition from $x$ to $x$ equal 0?
The limits written in the path integral are not values that you have to subtract off like in single variable definite integration. Think about non-relativistic QM: The integration is being done over a large number of intermediate $x_i$ variables $i=1$ to $N$. The ends of these paths are kept fixed while the intermediate variables are integrated from $-\infty$ to $\infty$, which are the actual limits of the definite integration being done.

More generally, how do we implement boundary conditions in the path integral?

In QFT, we don't usually do this path integral (which is ill-defined) . We just write it formally, use its formal properties to differentiate it wrt $J$ and derive a perturbation series for the correlation function.
A: First, even if the limits of the path integral were the same, you wouldn't expect the integral to vanish.
To take a toy example, consider an action $S[\phi]=k^2\phi^2$, and let's work in a $0$-dimensional spacetime, so the path integral is just a single 1-dimensional integral. Then
\begin{equation}
Z = \int_{-\infty}^{\infty} d\phi e^{i S[\phi]} = \frac{\sqrt{i \pi}}{k} \neq 0
\end{equation}
Second, $J$ will generally break the time-translation invariance of the integrand. Typically we aren't actually interested in $Z$, but rather time-ordered correlation functions like $\langle 0 | T\phi(x) \phi(y) | 0 \rangle$. The arguments of the correlation function will also break time-translation invariance of the integrand.
Finally, in QFT we actually usually do not fix value of the field at the "endpoints" of the path integral. The vacuum state $|0\rangle$ is not a field eigenstate, meaning that the field does not have a fixed value in the vacuum state.  In general, the way one deals with this situation is by including "wave functions" for the initial and final states in the path integral (these factors would be delta functionals in the case that we were fixing the initial and final field configurations). This is described (for example) in Weinberg's book. However, in the specific case of the vacuum state, there is a trick to work around this. Namely, by using the $i\epsilon$ prescription in the propagator, only the ground state contributes to the path integral in the limit of infinite time. So the $i\epsilon$ prescription gives an elegant way of incorporating the boundary conditions that the initial and final states should be the vacuum state.
