4. Let the function be
$$
f(x)=a x^{2}+4 x+b \text{, }
$$

the equation $f(x)=x$ has two real roots $\beta_{1}$ and $\beta_{2}$. If $a$ and $b$ are both negative integers, and $\left|\beta_{1}-\beta_{2}\right|=1$, then the coordinates of the vertex of the graph of the function $f(x)$ are $\qquad$
4. $(2,2)$.
$f(x)=x$ can be transformed into $a x^{2}+3 x+b=0$.
From the given conditions, we have
$$
\begin{array}{l}
\beta_{1}+\beta_{2}=-\frac{3}{a}, \beta_{1} \beta_{2}=\frac{b}{a} \\
\Rightarrow\left|\beta_{1}-\beta_{2}\right|=\sqrt{\left(\beta_{1}+\beta_{2}\right)^{2}-4 \beta_{1} \beta_{2}} \\
\quad=\sqrt{\frac{9-4 a b}{a^{2}}}=1 \\
\Rightarrow a(a+4 b)=9 .
\end{array}
$$

Since $a$ and $b$ are both negative integers, we have $a > a + 4b$.
$$
\text { Then }\left\{\begin{array} { l } 
{ a = - 1 , } \\
{ a + 4 b = - 9 }
\end{array} \Rightarrow \left\{\begin{array}{l}
a=-1, \\
b=-2 .
\end{array}\right.\right.
$$

Therefore, $f(x)=-x^{2}+4 x-2$.
Thus, the coordinates of the vertex of its graph are $(2,2)$.