Find all functions $f,g: \mathbb{Q}\to \mathbb{Q}$ such that the following two conditions hold:

$$f(g(x)-g(y))=f(g(x))-y \ \  (1)$$

$$g(f(x)-f(y))=g(f(x))-y\ \ (2)$$

for all $x,y \in \mathbb{Q}$.
1. **Injectivity of \( f \) and \( g \):**

   Let \( P(x, y) \) denote the assertion of the first equation:
   \[
   P(x, y): f(g(x) - g(y)) = f(g(x)) - y
   \]
   Let \( Q(x, y) \) denote the assertion of the second equation:
   \[
   Q(x, y): g(f(x) - f(y)) = g(f(x)) - y
   \]

   To prove that \( g \) is injective, assume \( g(a) = g(b) \). Then:
   \[
   P(x, a): f(g(x) - g(a)) = f(g(x)) - a
   \]
   \[
   P(x, b): f(g(x) - g(b)) = f(g(x)) - b
   \]
   Since \( g(a) = g(b) \), we have:
   \[
   f(g(x) - g(a)) = f(g(x) - g(b)) \implies f(g(x)) - a = f(g(x)) - b \implies a = b
   \]
   Therefore, \( g \) is injective.

   Similarly, to prove that \( f \) is injective, assume \( f(a) = f(b) \). Then:
   \[
   Q(x, a): g(f(x) - f(a)) = g(f(x)) - a
   \]
   \[
   Q(x, b): g(f(x) - f(b)) = g(f(x)) - b
   \]
   Since \( f(a) = f(b) \), we have:
   \[
   g(f(x) - f(a)) = g(f(x) - f(b)) \implies g(f(x)) - a = g(f(x)) - b \implies a = b
   \]
   Therefore, \( f \) is injective.

2. **Surjectivity of \( f \) and \( g \):**

   From \( P(x, x) \):
   \[
   f(g(x) - g(x)) = f(g(x)) - x \implies f(0) = f(g(x)) - x \implies f(g(x)) = x
   \]
   Thus, \( f \) is surjective.

   From \( Q(x, x) \):
   \[
   g(f(x) - f(x)) = g(f(x)) - x \implies g(0) = g(f(x)) - x \implies g(f(x)) = x
   \]
   Thus, \( g \) is surjective.

3. **Functional Equations:**

   Using the fact that \( f(g(x)) = x \) and \( g(f(x)) = x \) in \( P(f(x), f(y)) \):
   \[
   f(g(f(x)) - g(f(y))) = f(g(f(x))) - f(y) \implies f(x - y) = f(x) - f(y)
   \]
   This shows that \( f \) is additive.

   Using \( P(x, y) \):
   \[
   f(g(x) - g(y)) = f(g(x)) - y \implies f(g(x) - g(y)) = x - y
   \]
   Letting \( y \to -y \):
   \[
   f(g(x) + g(y)) = f(g(x)) + f(g(y)) \implies f(x + y) = f(x) + f(y)
   \]
   Therefore, \( f \) is also additive.

4. **Odd Function Property:**

   From \( f(g(x)) = x \) and \( g(f(x)) = x \):
   \[
   f(-g(x)) = -f(g(x)) \implies f(-x) = -f(x)
   \]
   This shows that \( f \) is an odd function.

5. **Linear Functions:**

   Since \( f \) is additive and odd, and the domain is the rational numbers, we can conclude that \( f(x) = cx \) for some constant \( c \).

   Plugging this result into \( g(f(x)) = x \):
   \[
   g(cx) = x \implies g(x) = \frac{x}{c}
   \]

   Therefore, the functions \( f \) and \( g \) are:
   \[
   f(x) = cx \quad \text{and} \quad g(x) = \frac{x}{c}
   \]

The final answer is \( \boxed{ f(x) = cx } \) and \( g(x) = \frac{x}{c} \) for all \( x \in \mathbb{Q} \).