For two given positive integers $ m,n > 1$, let $ a_{ij} (i = 1,2,\cdots,n, \; j = 1,2,\cdots,m)$ be nonnegative real numbers, not all zero, find the maximum and the minimum values of $ f$, where
\[ f = \frac {n\sum_{i = 1}^{n}(\sum_{j = 1}^{m}a_{ij})^2 + m\sum_{j = 1}^{m}(\sum_{i= 1}^{n}a_{ij})^2}{(\sum_{i = 1}^{n}\sum_{j = 1}^{m}a_{ij})^2 + mn\sum_{i = 1}^{n}\sum_{j=1}^{m}a_{ij}^2}. \]
1. **Denote the sums for convenience:**
   \[
   \sum_{j=1}^{m} a_{ij} = x_i \quad \text{and} \quad \sum_{i=1}^{n} a_{ij} = y_j
   \]
   Then, the function \( f \) can be rewritten as:
   \[
   f = \frac{n \sum_{i=1}^{n} x_i^2 + m \sum_{j=1}^{m} y_j^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}
   \]

2. **Maximum of \( f \):**
   We aim to show that the maximum value of \( f \) is 1. We need to prove:
   \[
   n \sum_{i=1}^{n} x_i^2 + m \sum_{j=1}^{m} y_j^2 \leq \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
   \]

3. **Using Karamata's Inequality:**
   Consider the sequences:
   \[
   (x_1, x_1, \ldots, x_1, x_2, \ldots, x_n, y_1, y_1, \ldots, y_1, y_2, \ldots, y_m)
   \]
   where each \( x_i \) appears \( n \) times and each \( y_j \) appears \( m \) times, and
   \[
   \left( \sum_{i=1}^{n} \sum_{j=1}^{m} a_{ij}, a_{11}, a_{12}, \ldots, a_{mn}, 0, 0, \ldots, 0 \right)
   \]
   where the 0's are added to make the number of terms equal.

   The latter sequence majorizes the former sequence. Since \( g(x) = x^2 \) is convex, by Karamata's inequality:
   \[
   n \sum_{i=1}^{n} x_i^2 + m \sum_{j=1}^{m} y_j^2 \leq \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
   \]
   Thus, the maximum value of \( f \) is 1.

4. **Minimum of \( f \):**
   We wish to show that:
   \[
   f \geq \frac{m+n}{mn + \min(m,n)}
   \]
   Assume \( m \geq n \), so \( \min(m,n) = n \). Denote:
   \[
   \sum_{i=1}^{n} x_i^2 = A, \quad \sum_{j=1}^{m} y_j^2 = B, \quad \sum_{i=1}^{n} \sum_{j=1}^{m} a_{ij}^2 = C, \quad \left( \sum_{i=1}^{n} \sum_{j=1}^{m} a_{ij} \right)^2 = D
   \]
   We need to prove:
   \[
   \frac{nA + mB}{mnC + D} \geq \frac{m+n}{mn+n}
   \]
   This is equivalent to:
   \[
   (nA + mB)(mn + n) \geq (mnC + D)(m + n)
   \]

5. **Using Cauchy-Schwarz Inequality:**
   By the Cauchy-Schwarz inequality:
   \[
   nA \geq D \quad \text{or} \quad (m+n)nA \geq (m+n)D \quad \text{(1)}
   \]
   Since:
   \[
   \sum_{i=1}^{n} x_i^2 \geq \sum_{i=1}^{n} \sum_{j=1}^{m} a_{ij}^2 \quad \text{and} \quad \sum_{j=1}^{m} y_j^2 \geq \sum_{i=1}^{n} \sum_{j=1}^{m} a_{ij}^2
   \]
   we have:
   \[
   A \geq C \quad \text{and} \quad B \geq C
   \]
   Therefore:
   \[
   n(mn+n)A \geq n(mn+n)C \quad \text{(2)}
   \]
   \[
   (m^2n - n^2)B \geq (m^2n - n^2)C \quad \text{(3)}
   \]
   Adding (1), (2), and (3) yields the desired result:
   \[
   (nA + mB)(mn + n) \geq (mnC + D)(m + n)
   \]

The final answer is \(\boxed{1}\) for the maximum and \(\boxed{\frac{m+n}{mn+n}}\) for the minimum.