Find all functions $f:\mathbb{R}\rightarrow \mathbb{R}$ such that
$\forall x\in \mathbb{R} \ \ f(x) = max(2xy-f(y))$ where $y\in \mathbb{R}$.
1. Given the functional equation:
   \[
   f(x) = \max(2xy - f(y)) \quad \forall x \in \mathbb{R}, \quad \text{where} \quad y \in \mathbb{R}
   \]
   We need to find all functions \( f: \mathbb{R} \rightarrow \mathbb{R} \) that satisfy this equation.

2. For any \( x \in \mathbb{R} \), the equation implies:
   \[
   f(x) \geq 2xy - f(y) \quad \forall y \in \mathbb{R}
   \]
   This inequality must hold for all \( y \).

3. Consider the specific case where \( y = x \):
   \[
   f(x) \geq 2x^2 - f(x)
   \]
   Rearranging this inequality, we get:
   \[
   2f(x) \geq 2x^2 \implies f(x) \geq x^2
   \]

4. Define a new function \( g(x) \) such that:
   \[
   g(x) = f(x) - x^2
   \]
   Since \( f(x) \geq x^2 \), it follows that \( g(x) \geq 0 \).

5. Substitute \( f(x) = g(x) + x^2 \) back into the original functional equation:
   \[
   g(x) + x^2 = \max(2xy - (g(y) + y^2)) \quad \forall y \in \mathbb{R}
   \]
   Simplifying the right-hand side:
   \[
   g(x) + x^2 = \max(2xy - g(y) - y^2)
   \]

6. Since \( g(x) \geq 0 \), we need to show that \( g(x) = 0 \). Consider the expression inside the maximum:
   \[
   2xy - g(y) - y^2
   \]
   For \( g(x) \) to be non-negative and the maximum to be zero, we must have:
   \[
   g(x) = \max\{-g(y) - (x-y)^2 \mid y \in \mathbb{R}\}
   \]
   Since \( g(x) \geq 0 \) and the right-hand side is non-positive, the only way for the equality to hold is if:
   \[
   g(x) = 0
   \]

7. Therefore, \( g(x) = 0 \) for all \( x \in \mathbb{R} \), which implies:
   \[
   f(x) = x^2
   \]

Conclusion:
\[
\boxed{f(x) = x^2}
\]