Find the functions $ f:\mathbb{N}\longrightarrow\mathbb{N} $ that satisfy the following relation:
$$ \gcd\left( x,f(y)\right)\cdot\text{lcm}\left(f(x), y\right) = \gcd (x,y)\cdot\text{lcm}\left( f(x), f(y)\right) ,\quad\forall x,y\in\mathbb{N} . $$
1. **Initial Setup and Simplification:**
   We start with the given functional equation:
   \[
   \gcd(x, f(y)) \cdot \text{lcm}(f(x), y) = \gcd(x, y) \cdot \text{lcm}(f(x), f(y)), \quad \forall x, y \in \mathbb{N}.
   \]
   Recall the relationship between gcd and lcm:
   \[
   \gcd(a, b) \cdot \text{lcm}(a, b) = a \cdot b.
   \]
   Using this, we can rewrite the given equation as:
   \[
   \gcd(x, f(y)) \cdot \frac{f(x) \cdot y}{\gcd(f(x), y)} = \gcd(x, y) \cdot \frac{f(x) \cdot f(y)}{\gcd(f(x), f(y))}.
   \]

2. **Substituting \( x = 1 \):**
   Let \( x = 1 \). Then the equation becomes:
   \[
   \gcd(1, f(y)) \cdot \frac{f(1) \cdot y}{\gcd(f(1), y)} = \gcd(1, y) \cdot \frac{f(1) \cdot f(y)}{\gcd(f(1), f(y))}.
   \]
   Since \(\gcd(1, a) = 1\) for any \(a\), this simplifies to:
   \[
   \frac{f(1) \cdot y}{\gcd(f(1), y)} = \frac{f(1) \cdot f(y)}{\gcd(f(1), f(y))}.
   \]
   Let \( c = f(1) \). Then we have:
   \[
   \frac{c \cdot y}{\gcd(c, y)} = \frac{c \cdot f(y)}{\gcd(c, f(y))}.
   \]
   This implies:
   \[
   \frac{y}{\gcd(c, y)} = \frac{f(y)}{\gcd(c, f(y))}. \quad \text{(1)}
   \]

3. **Substituting \( y = 1 \):**
   Let \( y = 1 \). Then the equation becomes:
   \[
   \gcd(x, c) \cdot \frac{f(x) \cdot 1}{\gcd(f(x), 1)} = \gcd(x, 1) \cdot \frac{f(x) \cdot c}{\gcd(f(x), c)}.
   \]
   Since \(\gcd(a, 1) = 1\) for any \(a\), this simplifies to:
   \[
   \gcd(x, c) \cdot f(x) = \gcd(x, 1) \cdot \frac{f(x) \cdot c}{\gcd(f(x), c)}.
   \]
   Since \(\gcd(x, 1) = 1\), we have:
   \[
   \gcd(x, c) \cdot f(x) = \frac{f(x) \cdot c}{\gcd(f(x), c)}.
   \]
   This implies:
   \[
   \gcd(x, c) \cdot \gcd(f(x), c) = c. \quad \text{(2)}
   \]

4. **Combining Results:**
   From equation (2), we have:
   \[
   \gcd(x, c) \cdot \gcd(f(x), c) = c.
   \]
   This suggests that \( f(x) \) must be of the form:
   \[
   f(x) = \frac{c \cdot x}{\gcd(c, x)^2}.
   \]
   In particular, for \( x = c^2 \), we get:
   \[
   f(c^2) = c.
   \]

5. **Determining \( c \):**
   Taking \( x = c^2 \) in equation (2), we get:
   \[
   \gcd(c^2, c) \cdot \gcd(f(c^2), c) = c.
   \]
   Since \( \gcd(c^2, c) = c \), we have:
   \[
   c \cdot \gcd(c, c) = c.
   \]
   This simplifies to:
   \[
   c^2 = c.
   \]
   Hence, \( c = 1 \).

6. **Final Function:**
   Since \( c = 1 \), we have:
   \[
   f(x) = \frac{1 \cdot x}{\gcd(1, x)^2} = x.
   \]
   Therefore, the function \( f(x) = x \) satisfies the given functional equation.

\(\blacksquare\)

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