Let $\mathbb{Q}$ be the set of rational numbers. Determine all functions $f : \mathbb{Q}\to\mathbb{Q}$ satisfying both of the following conditions.
[list=disc]
[*] $f(a)$ is not an integer for some rational number $a$.
[*] For any rational numbers $x$ and $y$, both $f(x + y) - f(x) - f(y)$ and $f(xy) - f(x)f(y)$ are integers.
[/list]
1. **Initial Setup and Notation:**
   - Let $\mathbb{Q}$ be the set of rational numbers.
   - We need to determine all functions $f : \mathbb{Q} \to \mathbb{Q}$ satisfying:
     1. $f(a)$ is not an integer for some rational number $a$.
     2. For any rational numbers $x$ and $y$, both $f(x + y) - f(x) - f(y)$ and $f(xy) - f(x)f(y)$ are integers.
   - We write $x \equiv y$ to indicate $x - y \in \mathbb{Z}$.

2. **Existence of a Non-Integer Value:**
   - From the first condition, there exists $a \in \mathbb{Q}$ such that $f(a) \in \mathbb{Q} \setminus \mathbb{Z}$.
   - Therefore, we can write $f(a) = \frac{a_1}{n}$ for some $a_1, n \in \mathbb{Z}$, $n \ge 2$ and $\gcd(a_1, n) = 1$.

3. **Claim 01: $f(a^\ell) = \frac{a_\ell}{n^\ell}$ for some $a_\ell \in \mathbb{Z}$ such that $\gcd(a_\ell, n) = 1$ for any $\ell \in \mathbb{N}$.**
   - **Proof by Induction:**
     - Base Case: For $\ell = 1$, the claim is true by definition.
     - Inductive Step: Assume the claim is true for $\ell = i$, i.e., $f(a^i) = \frac{a_i}{n^i}$ for some $a_i \in \mathbb{Z}$ such that $\gcd(a_i, n) = 1$.
     - Consider $\ell = i + 1$:
       \[
       f(a^{i + 1}) \equiv f(a^i)f(a) = \frac{a_i}{n^i} \cdot \frac{a_1}{n} = \frac{a_i a_1}{n^{i + 1}}
       \]
       - Since $\gcd(a_i, n) = 1$ and $\gcd(a_1, n) = 1$, it follows that $\gcd(a_i a_1, n) = 1$.
       - Thus, the claim holds for $\ell = i + 1$.

4. **Claim 02: $f(x + y) = f(x) + f(y)$ for any rational numbers $x$ and $y$.**
   - **Proof:**
     - Denote the conditions $f(x + y) \equiv f(x) + f(y)$ as (1) and $f(xy) \equiv f(x)f(y)$ as (2).
     - Consider:
       \[
       f(a^\ell)(f(x) + f(y)) \stackrel{(2)}{\equiv} f(a^\ell x) + f(a^\ell y) \stackrel{(1)}{\equiv} f(a^\ell (x + y)) \stackrel{(2)}{\equiv} f(a^\ell)f(x + y)
       \]
     - This implies:
       \[
       f(a^\ell)(f(x + y) - f(x) - f(y)) \equiv 0
       \]
       - Hence, $f(a^\ell)(f(x + y) - f(x) - f(y)) \in \mathbb{Z}$ for any positive integer $\ell$.
       - From Claim 01, if $f(x + y) - f(x) - f(y) = \frac{p}{q}$ for some $p, q \in \mathbb{Z}$ and $\gcd(p, q) = 1$, $q > 0$, then $n^\ell \mid p$ for any positive integer $\ell$.
       - This forces $p = 0$, i.e., $f(x + y) = f(x) + f(y)$.

5. **Final Claim: $f(x) = x$ for all $x \in \mathbb{Q}$.**
   - **Proof:**
     - Since $f: \mathbb{Q} \to \mathbb{Q}$ is additive, we conclude that $f(x) = cx$ for some $c \in \mathbb{Q}$.
     - Note that:
       \[
       0 \equiv f(x)f(y) - f(xy) = cxy(c - 1)
       \]
       for any $x, y \in \mathbb{Q}$.
     - Suppose $c \notin \{0, 1\}$, i.e., $c(c - 1) \neq 0$.
     - Take $xy = (1, z)$ where $0 < z < \frac{1}{|c(c - 1)|}$:
       \[
       |f(x)f(y) - f(xy)| = |cxy(c - 1)| = |c(c - 1)| \cdot z < 1
       \]
       - This implies $f(x)f(y) - f(xy) \not\equiv 0$, a contradiction.
     - Therefore, $c \in \{0, 1\}$.
     - If $c = 0$, then $f(x) = 0$ for all $x \in \mathbb{Q}$, contradicting the first condition.
     - Hence, $c = 1$, and $f(x) = x$ for all $x \in $\mathbb{Q}$.

The final answer is $\boxed{f(x) = x}$