Find all functions $f:[0,1] \to \mathbb{R}$ such that the inequality \[(x-y)^2\leq|f(x) -f(y)|\leq|x-y|\] is satisfied for all $x,y\in [0,1]$
1. **Analyzing the given inequality:**
   We start with the inequality given for the function \( f: [0,1] \to \mathbb{R} \):
   \[
   (x-y)^2 \leq |f(x) - f(y)| \leq |x-y|
   \]
   for all \( x, y \in [0,1] \).

2. **Considering the case \( x = 1 \) and \( y = 0 \):**
   \[
   (1-0)^2 \leq |f(1) - f(0)| \leq |1-0|
   \]
   Simplifying, we get:
   \[
   1 \leq |f(1) - f(0)| \leq 1
   \]
   This implies:
   \[
   |f(1) - f(0)| = 1
   \]

3. **Considering the form of the function \( f \):**
   Suppose \( f \) is a solution. Then, if we consider \( g(x) = \pm f(x) + C \), we need to check if \( g \) also satisfies the given inequality. 

4. **Assuming \( f(0) = 0 \) and \( f(1) = 1 \):**
   We simplify the problem by assuming \( f(0) = 0 \) and \( f(1) = 1 \). This assumption is valid because any linear transformation of \( f \) that preserves the inequality will still satisfy the conditions.

5. **Analyzing the inequality at the boundaries:**
   - For \( x \to 0 \):
     \[
     |f(y)| \leq y
     \]
   - For \( x \to 1 \):
     \[
     |1 - f(y)| \leq 1 - y
     \]

6. **Adding the two inequalities:**
   \[
   |f(y)| + |1 - f(y)| \leq y + (1 - y) = 1
   \]
   Since \( |f(y)| + |1 - f(y)| \geq 1 \) (because \( f(0) = 0 \) and \( f(1) = 1 \)), we have:
   \[
   |f(y)| + |1 - f(y)| = 1
   \]

7. **Concluding the form of \( f \):**
   The only function that satisfies both \( |f(y)| \leq y \) and \( |1 - f(y)| \leq 1 - y \) while maintaining the equality \( |f(y)| + |1 - f(y)| = 1 \) is:
   \[
   f(y) = y
   \]
   Therefore, the general solution is:
   \[
   f(x) = \pm x + C
   \]

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