Find all functions $f$ from the interval $(1,\infty)$ to $(1,\infty)$ with the following property: if $x,y\in(1,\infty)$ and $x^2\le y\le x^3,$ then $(f(x))^2\le f(y) \le (f(x))^3.$

1. **Transform the Problem:**
   Let \( h(x) = \log f(e^x) \). The original problem can be transformed into finding all functions \( h: \mathbb{R}_{>0} \to \mathbb{R}_{>0} \) such that:
   \[
   2 \le \frac{b}{a} \le 3 \implies 2 \le \frac{h(b)}{h(a)} \le 3
   \]
   for all \( a, b > 0 \).

2. **Claim: \( h(x) = kx \) for some positive constant \( k \):**
   To prove this, we need to show that \( h \) is a linear function.

3. **First Claim:**
   For any positive integers \( m \) and \( n \), we have:
   \[
   \frac{h(2^n/3^m)}{h(1)} \ge \frac{2^n}{3^m} \quad \text{and} \quad \frac{h(3^m/2^n)}{h(1)} \le \frac{3^m}{2^n}.
   \]

4. **Proof of the First Claim:**
   - Note that \( 2 \le \frac{2x}{x} \le 3 \), so \( h(2x) \ge 2h(x) \). Iterating, we get \( h(2^n x) \ge 2^n h(x) \) for all positive integers \( n \).
   - Also, \( 2 \le \frac{y}{y/3} \le 3 \), so \( \frac{h(y)}{h(y/3)} \le 3 \), which implies \( h(\frac{1}{3} y) \ge \frac{1}{3} h(y) \). Iterating this process, we get \( h(\frac{1}{3^m} y) \ge \frac{1}{3^m} h(y) \) for all positive integers \( m \).

   Plugging in \( x = y/3^m \) into the first inequality, we get:
   \[
   h\left(\frac{2^n}{3^m} y\right) \ge 2^n h\left(\frac{y}{3^m}\right) \ge \frac{2^n}{3^m} h(y),
   \]
   so plugging in \( y = 1 \) proves the first part of the claim. The second part is shown similarly by reciprocating everything.

5. **Second Claim: \( h \) is strictly increasing:**
   Suppose \( x > y \) and \( h(x) \le h(y) \). Then for any positive integers \( d \) and \( e \), we have:
   \[
   h(2^d y) \ge 2^d y \quad \text{and} \quad h(3^e x) \le 3^e h(x),
   \]
   so:
   \[
   \frac{h(3^e x)}{3^e} \le h(x) \le h(y) \le \frac{h(2^d y)}{2^d} \implies \frac{h(2^d y)}{h(3^e x)} \ge \frac{2^d}{3^e}.
   \]
   If we can choose \( d \) and \( e \) such that \( \frac{2^d y}{3^e x} \le 3 \) but \( \frac{2^d}{3^e} > 3 \), then we have a contradiction. Since \( \frac{y}{x} < 1 \) and \( \{2^d/3^e \mid d, e \in \mathbb{N}\} \) is dense in \( \mathbb{Q} \), we can choose suitable \( d \) and \( e \).

6. **Final Argument:**
   Fix a real \( x \). Since \( \{2^d/3^e \mid d, e \in \mathbb{N}\} \) is dense in \( \mathbb{Q} \), we can approximate \( x \) by \( 2^n/3^m \) for some \( m \) and \( n \) and by \( 3^{m'}/2^{n'} \) for some \( m' \) and \( n' \). Since \( h \) is increasing, bounding \( x \) between \( 2^n/3^m \) and \( 3^{m'}/2^{n'} \) bounds \( h(x) \) between \( h(2^n/3^m)/h(1) \) and \( h(3^{m'}/2^{n'})/h(1) \). Making these arbitrarily close gives \( h(x)/h(1) = x \), as desired.

\(\blacksquare\)

The final answer is \( \boxed{ h(x) = kx } \) for some positive constant \( k \).