7. Find all functions $f: \mathbf{R} \rightarrow \mathbf{R}$, such that $f(0) \neq 0$, and for all real numbers $x, y$, we have
$$
\begin{array}{l}
f^{2}(x+y) \\
=2 f(x) f(y)+\max \left\{f\left(x^{2}\right)+f\left(y^{2}\right), f\left(x^{2}+y^{2}\right)\right\} .
\end{array}
$$
7. In equation (1), taking $x=y=0$ yields
$$
f^{2}(0)=2 f^{2}(0)+\max \{2 f(0), f(0)\} \text {. }
$$

If $f(0)>0$, then the above equation does not hold.
Thus, $f(0)=0$.
Assume $f(a)=1$. In equation (5), taking $x=a$ gives $f^{2}(2a)=1$.
In equation (1), taking $x=y=1$ gives
$1=2+\max \left\{2 f\left(a^{2}\right), f\left(2 a^{2}\right)\right\}$.
In equation (2), taking $x=a$ gives $f\left(a^{2}\right)=3$, then
$$
1 \geqslant 2+6 \text {, }
$$

which is a contradiction.
Therefore, $f(a) \neq 1$.
Since $f(a) \neq \pm 1$, we have
$$
f(a)= \pm\left(2 f\left(\frac{a}{2}\right)+1\right) \text {. }
$$

Similarly, $f(-a)= \pm\left(2 f\left(-\frac{a}{2}\right)+1\right)$.
By $f(a)=f(-a)$, if $f\left(\frac{a}{2}\right)=f\left(-\frac{a}{2}\right)$, then these two expressions are equal.
In particular, in equation (5), taking $x=\frac{a}{2}$ gives
$$
f^{2}(a)=f^{2}\left(2 \cdot \frac{a}{2}\right)=1,
$$

which is a contradiction.
By equation (4), we know $f\left(\frac{a}{2}\right)+f\left(-\frac{a}{2}\right)=-2$.
Then $\pm\left(2 f\left(\frac{a}{2}\right)+1\right)= \pm\left(2 f\left(-\frac{a}{2}\right)+1\right)$
$$
= \pm\left(-2 f\left(\frac{a}{2}\right)-3\right) \text {. }
$$

For any choice of positive or negative signs in the above equation, either a contradiction arises or $f\left(\frac{a}{2}\right)=-1$.
Thus, $f\left(-\frac{a}{2}\right)=-1$, i.e., $f\left(\frac{a}{2}\right)=f\left(-\frac{a}{2}\right)$.
Therefore, $f^{2}(a)=1$, which is a contradiction.
The lemma is proved.
In equation (1), substituting $-x, -y$ for $x, y$ and comparing with equation (1) gives
$$
\begin{array}{l}
f^{2}(x+y)-2 f(x) f(y) \\
=f^{2}(-x-y)-2 f(-x) f(-y) .
\end{array}
$$

By the lemma, $f(x+y)=f(x)+f(y)+1$.
Rewriting equation (2) as $(f(x)+1)^{2}=f\left(x^{2}\right)+1$.
Let $g(x)=f(x)+1$. Then
$$
\begin{array}{l}
g(x+y)=g(x)+g(y), \\
g^{2}(x)=g\left(x^{2}\right) \geqslant 0 .
\end{array}
$$

Thus, for non-negative real numbers $y$, we have $f(y) \geqslant 0$.
For any function $g(x)$ satisfying the Cauchy equation
$$
g(x+y)=g(x)+g(y)
$$

$g(x)$ must be monotonically increasing. Therefore, $g(x)=c x$ (where $c$ is a non-negative constant).
$$
\text { By }(c x)^{2}=g^{2}(x)=g\left(x^{2}\right)=c x^{2}
$$
$$
\Rightarrow c=0 \text { or } 1 \text {. }
$$

Thus, $f(x)=-1$ or $f(x)=x-1$.
Upon verification, both functions satisfy equation (1).