(a) Determine all pairs $(x, y)$ of (real) numbers with $0 < x < 1$ and $0 <y < 1$ for which $x + 3y$ and $3x + y$ are both integer. An example is $(x,y) =( \frac{8}{3}, \frac{7}{8}) $, because $  x+3y =\frac38 +\frac{21}{8} =\frac{24}{8} =  3$ and $ 3x+y = \frac98 + \frac78 =\frac{16}{8} = 2$.

(b) Determine the integer $m > 2$ for which there are exactly $119$ pairs $(x,y)$ with $0 < x < 1$ and $0 < y < 1$ such that $x + my$ and  $mx + y$ are integers.

Remark: if $u \ne v,$ the pairs $(u, v)$ and $(v, u)$ are different.
### Part (a)
1. We need to find all pairs \((x, y)\) of real numbers such that \(0 < x < 1\) and \(0 < y < 1\) for which \(x + 3y\) and \(3x + y\) are both integers.
2. Let \(x + 3y = a\) and \(3x + y = b\) where \(a\) and \(b\) are integers.
3. We can solve these equations for \(x\) and \(y\):
   \[
   x + 3y = a \quad \text{(1)}
   \]
   \[
   3x + y = b \quad \text{(2)}
   \]
4. Multiply equation (1) by 3:
   \[
   3x + 9y = 3a \quad \text{(3)}
   \]
5. Subtract equation (2) from equation (3):
   \[
   3x + 9y - (3x + y) = 3a - b
   \]
   \[
   8y = 3a - b
   \]
   \[
   y = \frac{3a - b}{8} \quad \text{(4)}
   \]
6. Substitute equation (4) into equation (1):
   \[
   x + 3\left(\frac{3a - b}{8}\right) = a
   \]
   \[
   x + \frac{9a - 3b}{8} = a
   \]
   \[
   x = a - \frac{9a - 3b}{8}
   \]
   \[
   x = \frac{8a - (9a - 3b)}{8}
   \]
   \[
   x = \frac{8a - 9a + 3b}{8}
   \]
   \[
   x = \frac{3b - a}{8} \quad \text{(5)}
   \]
7. For \(x\) and \(y\) to be in the interval \((0, 1)\), we need:
   \[
   0 < \frac{3b - a}{8} < 1 \quad \text{and} \quad 0 < \frac{3a - b}{8} < 1
   \]
8. This implies:
   \[
   0 < 3b - a < 8 \quad \text{and} \quad 0 < 3a - b < 8
   \]
9. Solving these inequalities:
   \[
   0 < 3b - a < 8 \implies a < 3b < a + 8
   \]
   \[
   0 < 3a - b < 8 \implies b < 3a < b + 8
   \]
10. These inequalities must be satisfied simultaneously for \(a\) and \(b\) to be integers.

### Part (b)
1. We are given the system of equations:
   \[
   x + my = a \quad \text{(1)}
   \]
   \[
   mx + y = b \quad \text{(2)}
   \]
   where \(0 < x, y < 1\) and \(a, b \in \mathbb{Z}\).
2. Solving for \(x\) and \(y\):
   \[
   x = \frac{ma - b}{m^2 - 1} \quad \text{(3)}
   \]
   \[
   y = \frac{mb - a}{m^2 - 1} \quad \text{(4)}
   \]
3. For \(x\) and \(y\) to be in the interval \((0, 1)\), we need:
   \[
   0 < \frac{ma - b}{m^2 - 1} < 1 \quad \text{and} \quad 0 < \frac{mb - a}{m^2 - 1} < 1
   \]
4. This implies:
   \[
   0 < ma - b < m^2 - 1 \quad \text{and} \quad 0 < mb - a < m^2 - 1
   \]
5. Solving these inequalities:
   \[
   0 < ma - b < m^2 - 1 \implies b < ma < b + m^2 - 1
   \]
   \[
   0 < mb - a < m^2 - 1 \implies a < mb < a + m^2 - 1
   \]
6. These inequalities must be satisfied simultaneously for \(a\) and \(b\) to be integers.
7. The number of valid pairs \((a, b)\) is given by:
   \[
   S_m = m(m - 1) + m - 2 = m^2 - 2
   \]
8. Given \(S_m = 119\):
   \[
   m^2 - 2 = 119
   \]
   \[
   m^2 = 121
   \]
   \[
   m = 11
   \]

The final answer is \( \boxed{ m = 11 } \)