3. Given $x, y > 0$. If
$$
f(x, y)=\left(x^{2}+y^{2}+2\right)\left(\frac{1}{x+y}+\frac{1}{x y+1}\right) \text {, }
$$

then the minimum value of $f(x, y)$ is . $\qquad$
3.4.

By completing the square, we get
$$
x^{2}+y^{2}+2 \geqslant(x+y)+(x y+1) \text {. }
$$

Then $f(x, y)$
$$
\begin{array}{l}
\geqslant((x+y)+(x y+1))\left(\frac{1}{x+y}+\frac{1}{x y+1}\right) \\
\geqslant(1+1)^{2}=4 .
\end{array}
$$

Equality holds if and only if $x=y=1$.