3. Given the function $f(x)$ satisfies
$$
f^{2}(x+1)+f^{2}(x)=f(x+1)+f(x)+4 \text {. }
$$

Then the maximum value of $f(1)+f(2020)$ is $\qquad$
3. 4 .

From the given equation, we have
$$
\begin{array}{l}
f^{2}(x+2)+f^{2}(x+1)=f(x+2)+f(x+1)+4 \\
\Rightarrow f^{2}(x+2)-f(x+2)=f^{2}(x)-f(x) .
\end{array}
$$

Thus, for any integer $n$, we have
$$
\begin{array}{l}
f^{2}(x+2 n)-f(x+2 n)=f^{2}(x)-f(x) . \\
\text { Hence } 4=f^{2}(2020)-f(2020)+f^{2}(1)-f(1) \\
\geqslant \frac{1}{2}(f(1)+f(2020))^{2}-(f(1)+f(2020)) \\
\Rightarrow f(1)+f(2020) \leqslant 4 .
\end{array}
$$

When the function $f(x) \equiv 2$, the desired maximum value 4 can be achieved.