(3) Let $x, y \in \mathbf{R}$, find the minimum value of the function $z=\sqrt{x^{2}+y^{2}}+\sqrt{(1-x)^{2}+y^{2}}+$ $\sqrt{(1-x)^{2}+(1-y)^{2}}+\sqrt{x^{2}+(1-y)^{2}}$.
(Answer: When $x=y=\frac{1}{2}$, $z$ takes the minimum value $2 \sqrt{2}$ )