$$
\begin{array}{l}
\text { Let } g(t)=\sqrt{t-t^{2}}+\sqrt{2 t-t^{2}}, t \in(0,1], g^{\prime}(t)=\frac{1-2 t}{2 \sqrt{t-t^{2}}}+\frac{2-2 t}{2 \sqrt{2 t-t^{2}}} \text {. } \\
\text { Let } g^{\prime}(t)=0 \Rightarrow \frac{2-2 t}{2 \sqrt{2 t-t^{2}}}=\frac{2 t-1}{2 \sqrt{t-t^{2}}} \Rightarrow 4(1-t)^{3}=(2 t-1)^{2}(2-t) \\
\Rightarrow 4\left(1-3 t+3 t^{2}-t^{3}\right)=\left(4 t^{2}-4 t+1\right)(2-t)=12 t^{2}-4 t^{3}-9 t+2 \Rightarrow 4-12 t=-9 t+2 \Rightarrow t=\frac{2}{3} \text {, }
\end{array}
$$

Then $g^{\prime}(t)=0$ has a unique root $t=\frac{2}{3}$ in $(0,1]$, so $g(x)$ is monotonically increasing on $\left(0, \frac{2}{3}\right)$ and monotonically decreasing on $\left(\frac{2}{3}, 1\right)$. Therefore, $g(t)_{\max }=g\left(\frac{2}{3}\right)=\sqrt{2}$. Thus, the maximum value of the function $f(x)$ is $\sqrt{2}$. Note: By applying the Cauchy-Schwarz inequality $a c+b d \leqslant \sqrt{\left(a^{2}+b^{2}\right)\left(c^{2}+d^{2}\right)}$, we get
$$
\sqrt{x^{2}} \cdot \sqrt{1-x^{2}}+\sqrt{2-x^{2}} \cdot \sqrt{x^{2}} \leqslant \sqrt{\left(x^{2}+2-x^{2}\right)\left(1-x^{2}+x^{2}\right)}=\sqrt{2} \text {. }
$$
5. The maximum value of the function $f(x)=\sqrt{x^{2}-x^{4}}+\sqrt{2 x^{2}-x^{4}}$ is