3. In the Cartesian coordinate plane, a point whose both horizontal and vertical coordinates are integers is called an integer point: Let $n$ be a positive integer, then the number of integer points inside (including the boundary) the square $G_{n}$ as shown in Figure 1 is ( ).
(A) $4 n+1$
(B) $8 n-3$
(C) $n^{2}+2 n+2$
(D) $2 n^{2}+2 n+1$
3.D.

Let the number of integer points inside the square $G_{n}$ be $a_{n}$. Clearly, $a_{1}=5$. When $n$ increases to $n+1$, the integer points added in the first quadrant (including the positive half-axis of the $x$-axis) are $(1, n),(2, n-1),\left(3, n-n_{n}^{\circ}, \cdots\right.$, $(n, 1),(n+1,0)$, a total of $n+1$ points. By symmetry, the square $G_{n+1}$ adds a total of $4(n+1)$ integer points. This leads to the recurrence relation
$$
\begin{array}{l}
a_{1}=5, a_{n+1}=a_{n}+4(n+1) . \\
\text { Hence } a_{n}=a_{1}+\left(a_{2}-a_{1}\right)+\left(a_{3}-a_{2}\right)+\cdots+\left(a_{n}-a_{n-1}\right) \\
=5+4(2+3+\cdots+n)=2 n^{2}+2 n+1 .
\end{array}
$$