5. The minimum value of the function $f(x)=\sqrt{\frac{x^{4}}{16}+\frac{x^{2}}{2}+1}+\sqrt{\frac{x^{4}}{16}-4 x+8}$ is
$$
\begin{array}{l}
f(x)=\sqrt{\frac{x^{4}}{16}+\frac{x^{2}}{2}+1}+\sqrt{\frac{x^{4}}{16}-4 x+8} \\
=\frac{x^{2}}{4}+1+\sqrt{\left(\frac{x^{2}}{4}-2\right)^{2}+(x-2)^{2}},
\end{array}
$$
The geometric meaning of $f(x)$ is the sum of the distance from a point $P(x, y)$ on the parabola $y=\frac{x^{2}}{4}$ to the line $y=-1$ and the distance to the point $(2,2)$.
As shown in the figure, $|P A|+|P B| \geqslant|A B|$, with equality holding when $A, P, B$ are collinear. Therefore, when $x=2$, the minimum value of the function $f(x)$ is 3.