5. Given that the radius of $\odot O$ is 1, quadrilateral $ABCD$ is an inscribed square, $EF$ is a diameter of $\odot O$, and $M$ is a moving point on the boundary of square $ABCD$, then the minimum value of $\overrightarrow{M E} \cdot \overrightarrow{M F}$ is $\qquad$. (Yang Ying provided the problem)
5. $-\frac{1}{2}$.
(Method 1) It is easy to know that $\overrightarrow{A E} \cdot \overrightarrow{A F}=0, \overrightarrow{A E}+\overrightarrow{A F}=2 \overrightarrow{A O}=\overrightarrow{A C}$. Without loss of generality, assume point $M$ is on side $A D$, and let $|\overrightarrow{M A}|=t$, then
$$
\begin{aligned}
\overrightarrow{M E} \cdot \overrightarrow{M F} & =(\overrightarrow{M A}+\overrightarrow{A E}) \cdot(\overrightarrow{M A}+\overrightarrow{A F}) \\
& =|\overrightarrow{M A}|^{2}+\overrightarrow{A E} \cdot \overrightarrow{A F}+\overrightarrow{M A} \cdot(\overrightarrow{A E}+\overrightarrow{A F})=|\overrightarrow{M A}|^{2}+\overrightarrow{M A} \cdot \overrightarrow{M C} \\
& =t^{2}-\sqrt{2} t=\left(t-\frac{\sqrt{2}}{2}\right)^{2}-\frac{1}{2} \geqslant-\frac{1}{2}
\end{aligned}
$$

where the equality holds if and only if $t=\frac{\sqrt{2}}{2}$. Therefore, the minimum value of $\overrightarrow{M E} \cdot \overrightarrow{M F}$ is $-\frac{1}{2}$. (Method 2) By the median length formula, we have
$$
\frac{1}{2}\left(|\overrightarrow{M E}|^{2}+|\overrightarrow{M F}|^{2}\right)=|\overrightarrow{M O}|^{2}+\frac{1}{4}|\overrightarrow{E F}|^{2} .
$$

Thus,
$$
\begin{aligned}
\overrightarrow{M E} \cdot \overrightarrow{M F} & =\frac{1}{2}\left(|\overrightarrow{M E}+\overrightarrow{M F}|^{2}-|\overrightarrow{M E}|^{2}-|\overrightarrow{M F}|^{2}\right) \\
& =2|\overrightarrow{M O}|^{2}-\left(|\overrightarrow{M O}|^{2}+\frac{1}{4}|\overrightarrow{E F}|^{2}\right) \\
& =|\overrightarrow{M O}|^{2}-1
\end{aligned}
$$

It is easy to see that when $M$ is the midpoint of one of the sides of the square $A B C D$, $|\overrightarrow{M O}|$ reaches its minimum value $\frac{\sqrt{2}}{2}$, therefore, the minimum value of $\overrightarrow{M E} \cdot \overrightarrow{M F}$ is $-\frac{1}{2}$.
(Method 3) Taking $O$ as the origin, establish a Cartesian coordinate system as shown in Figure 3, where sides $B C$ and $A B$ are parallel to the $x$ and $y$ axes, respectively. Let the coordinates of point $E$ be $(x, y)$, then $F(-x,-y)$. Without loss of generality, assume point $M$ is on side $A D$, and the coordinates of point $M$ are $\left(t, \frac{\sqrt{2}}{2}\right)$. It is easy to know
$$
x^{2}+y^{2}=1, \quad-\frac{\sqrt{2}}{2} \leqslant t \leqslant \frac{\sqrt{2}}{2} .
$$

It is easy to know $\overrightarrow{M E}=\left(x-t, y-\frac{\sqrt{2}}{2}\right), \overrightarrow{M F}=\left(-x-t,-y-\frac{\sqrt{2}}{2}\right)$, thus
$$
\overrightarrow{M E} \cdot \overrightarrow{M F}=t^{2}+\frac{1}{2}-\left(x^{2}+y^{2}\right)=t^{2}-\frac{1}{2} \geqslant-\frac{1}{2} \text {. }
$$

where the equality holds if and only if $t=0$. Therefore, the minimum value of $\overrightarrow{M E} \cdot \overrightarrow{M F}$ is $-\frac{1}{2}$.