Five, let $m$ and $n$ be given integers greater than 1, and $a_{ij}$ $(i=1,2, \cdots, n ; j=1,2, \cdots, m)$ be $mn$ non-negative real numbers, not all zero. Find
$$
f=\frac{n \sum_{i=1}^{n}\left(\sum_{j=1}^{m} a_{ij}\right)^{2}+m \sum_{j=1}^{m}\left(\sum_{i=1}^{n} a_{ij}\right)^{2}}{\left(\sum_{i=1}^{n} \sum_{j=1}^{m} a_{ij}\right)^{2}+mn \sum_{i=1}^{n} \sum_{j=1}^{m} a_{ij}^{2}}
$$

the maximum and minimum values.
(Provided by Zhu Huawei)
Five, the maximum value of $f$ is 1.
First, prove that $f \leqslant 1$.
This is equivalent to
$n \sum_{i=1}^{n}\left(\sum_{j=1}^{m} a_{i j}\right)^{2}+m \sum_{j=1}^{m}\left(\sum_{i=1}^{n} a_{i j}\right)^{2}$
$\leqslant\left(\sum_{i=1}^{n} \sum_{j=1}^{m} a_{i j}\right)^{2}+m n \sum_{i=1}^{n} \sum_{j=1}^{m} a_{i j}^{2}$
Let $G=\left(\sum_{i=1}^{n} \sum_{j=1}^{m} a_{i j}\right)^{2}+m n \sum_{i=1}^{n} \sum_{j=1}^{m} a_{i j}^{2}-$
$n \sum_{i=1}^{n}\left(\sum_{j=1}^{m} a_{i j}\right)^{2}-m \sum_{j=1}^{m}\left(\sum_{i=1}^{n} a_{i j}\right)^{2}$.
It suffices to prove that $G \geqslant 0$.
Now, arrange all $a_{i j}$ into an $n$-row, $m$-column table, such that $a_{i j}$ is in the $i$-th row and $j$-th column. Consider the 4 numbers in the table that form a rectangle, denoted as $a_{p q} \backslash a_{m \varpi} \backslash a_{s q} 、 a_{m}$, and call them a rectangular array, denoted as $[p s q r]$, where $1 \leqslant p < s \leqslant n, 1 \leqslant q < r \leqslant m$.

Let $G^{*}=\sum\left(a_{p q}+a_{s g}-a_{p s}-a_{g q}\right)^{2}$, where the summation runs over all rectangular arrays $[p s q]$.
We will prove that $G = G^{*}$.
First, compare the coefficients of terms of the form $a_{i j}^{2}$. For a fixed $i, j$, it is easy to see that the coefficient of $a_{i j}^{2}$ in $G$ is $m n + 1 - m - n$. In $G^{*}$, since there are $(m-1)(n-1)$ rectangular arrays with $a_{i j}$ as one of the vertices, the coefficient of $a_{i j}^{2}$ in $G^{*}$ is
$(m-1)(n-1) = m n + 1 - m - n$.
This shows that the coefficients of $a_{i j}^{2}$ terms in $G$ and $G^{*}$ are equal.
Second, compare the coefficients of terms of the form $a_{i j} a_{\mathcal{N}} (j \neq k)$. The coefficient in $G$ is $-2(n-1)$, and in $G^{*}$, the corresponding rectangular array $[p s q r]$ has another row index $s$ with $n-1$ choices, so the coefficient in $G^{*}$ is also $-2(n-1)$. This shows that the coefficients of terms of the form $a_{i j} a_{i k} (j \neq k)$ in $G$ and $G^{*}$ are equal.
Third, similarly, the coefficients of terms of the form $a_{i k k} a_{j k} (i \neq j)$ in $G$ and $G^{*}$ are both $-2(m-1)$.
Finally, the coefficients of terms of the form $a_{p q} a_{s t} (p \neq s, q \neq t)$ in $G$ and $G^{*}$ are both 2.
In summary, equation (2) holds.
Thus, $G \geqslant 0$, and equation (1) is proved.
When all $a_{i j} (i=1,2, \cdots, n ; j=1,2, \cdots, m)$ are 1, $f=1$, so the maximum value of $f$ is 1.
The minimum value of $f$ is $\frac{m+n}{m n+\min \{m, n\}}$.
First, prove that $f \geqslant \frac{m+n}{m n+\min \{m, n\}}$.
Without loss of generality, assume $n \leqslant m$. In this case, it suffices to prove
$f \geqslant \frac{m+n}{m n+n}$.
Let $S=\frac{n^{2}(m+1)}{m+n} \sum_{i=1}^{n} r_{i}^{2}+\frac{m n(m+1)}{m+n} \sum_{j=1}^{m} c_{j}^{2}$
$$
-\left(\sum_{i=1}^{n} \sum_{j=1}^{m} a_{i j}\right)^{2}-m n \sum_{i=1}^{n} \sum_{j=1}^{m} a_{i j}^{2} \text {, }
$$

where $r_{i}=\sum_{j=1}^{m} a_{i j} (i=1,2, \cdots, n), c_{j}=\sum_{i=1}^{n} a_{i j} (j=1,2, \cdots, m)$. To prove equation (3), it suffices to prove $S \geqslant 0$.
In the Lagrange identity
$\left(\sum_{i=1}^{n} a_{i} b_{i}\right)^{2}$
$=\left(\sum_{i=1}^{n} a_{i}^{2}\right)\left(\sum_{i=1}^{n} b_{i}^{2}\right)-\sum_{1 \leqslant k<1 \leqslant n}\left(a_{k} b_{l}-a_{l} b_{k}\right)^{2}$

let $a_{i}=r_{i}, b_{i}=1 (i=1,2, \cdots, n)$ to get
$-\left(\sum_{i=1}^{n} \sum_{j=1}^{m} a_{i j}\right)^{2}$
$=-n \sum_{i=1}^{n} r_{i}^{2}+\sum_{1 \leqslant k<l \leqslant n}\left(r_{k}-r_{l}\right)^{2}$.
Substituting the above into the expression for $S$ yields
$$
\begin{array}{c}
S=\frac{m n(n-1)}{m+n} \sum_{i=1}^{n} r_{i}^{2}+\frac{m n(m+1)}{m+n} \sum_{j=1}^{m} c_{j}^{2}- \\
m n \sum_{i=1}^{n} \sum_{j=1}^{m} a_{i j}^{2}+\sum_{1 \leqslant k<l \mid n}\left(r_{k}-r_{l}\right)^{2} . \\
\text { Since } m n=\frac{m n(n-1)}{m+n}+\frac{m n(m+1)}{m+n}, \text { so }
\end{array}
$$

$S$ can be rewritten as
$$
\begin{array}{c}
S=\frac{m n(n-1)}{m+n} \sum_{j=1}^{m} \sum_{i=1}^{n} a_{i j}\left(r_{i}-a_{i j}\right)+ \\
\frac{m n(m+1)}{m+n} \sum_{j=1}^{m} \sum_{i=1}^{n} a_{i j}\left(c_{j}-a_{i j}\right)+ \\
\sum_{1 \leqslant k<l \leqslant n}\left(r_{k}-r_{l}\right)^{2} .
\end{array}
$$

Since all $a_{i j} \geqslant 0$, and $r_{i}-a_{i j} \geqslant 0, c_{j}-a_{i j} \geqslant 0 (i=1,2, \cdots, n ; j=1,2, \cdots, m)$, it follows from equation (5) that $S \geqslant 0$, i.e., equation (4) holds.

When $a_{11}=a_{22}=\cdots=a_{m n}=1$, and all other elements are 0, $f=\frac{m+n}{m n+n}$, so the minimum value of $f$ is $\frac{m+n}{m n+n}$.

Similarly, when $n \geqslant m$, the minimum value of $f$ is $\frac{m+n}{m n+n}$.
Therefore, the minimum value of $f$ is $\frac{m+n}{m n+\min \{m, n\}}$.