For a natural number $m>1$ we'll denote with $f(m)$ the sum of all natural numbers less than $m$, which are also coprime to $m$. Find all natural numbers $n$, such that there exist natural numbers $k$ and $\ell$ which satisfy $f(n^{k})=n^{\ell}$.
1. We start by defining \( f(m) \) as the sum of all natural numbers less than \( m \) that are coprime to \( m \). This can be expressed as:
   \[
   f(m) = \sum_{\substack{d \leq m-1 \\ (d, m) = 1}} d
   \]
   Using properties of Euler's totient function \( \varphi(m) \), we know that the sum of all numbers less than \( m \) and coprime to \( m \) is given by:
   \[
   f(m) = \frac{m \varphi(m)}{2}
   \]
   This is derived by considering the pairs \((d, m-d)\) where \((d, m) = (m-d, m) = 1\), and noting that these pairs partition the set \(\{1 \leq d \leq m-1 : (d, m) = 1\}\).

2. We need to find all natural numbers \( n \) such that there exist natural numbers \( k \) and \( \ell \) satisfying:
   \[
   f(n^k) = n^\ell
   \]
   Substituting the expression for \( f(m) \), we get:
   \[
   f(n^k) = \frac{n^k \varphi(n^k)}{2}
   \]
   Since \( \varphi(n^k) = n^k \prod_{p \mid n} \left(1 - \frac{1}{p}\right) \), we have:
   \[
   \varphi(n^k) = n^k \varphi(n)
   \]
   Therefore:
   \[
   f(n^k) = \frac{n^k \cdot n^k \varphi(n)}{2} = \frac{n^{2k} \varphi(n)}{2}
   \]
   Setting this equal to \( n^\ell \), we get:
   \[
   \frac{n^{2k} \varphi(n)}{2} = n^\ell
   \]
   Simplifying, we obtain:
   \[
   n^{2k} \varphi(n) = 2n^\ell
   \]
   \[
   \varphi(n) = 2n^{\ell - 2k}
   \]

3. We now need to find \( n \) such that \( \varphi(n) = 2n^{\ell - 2k} \). We will consider different cases for \( n \).

4. **Case 1: \( n \) is a prime number.**
   - If \( n = p \) (a prime), then \( \varphi(p) = p-1 \).
   - Substituting into the equation, we get:
     \[
     p-1 = 2p^{\ell - 2k}
     \]
   - This equation must hold for some \( k \) and \( \ell \). Testing small primes:
     - For \( n = 2 \):
       \[
       2-1 = 2 \cdot 2^{\ell - 2k} \implies 1 = 2^{\ell - 2k + 1}
       \]
       This is not possible since \( 2^{\ell - 2k + 1} \) cannot be 1.
     - For \( n = 3 \):
       \[
       3-1 = 2 \cdot 3^{\ell - 2k} \implies 2 = 2 \cdot 3^{\ell - 2k} \implies 1 = 3^{\ell - 2k}
       \]
       This is possible if \( \ell - 2k = 0 \), i.e., \( \ell = 2k \). Thus, \( n = 3 \) is a solution with \( k = 1 \) and \( \ell = 1 \).

5. **Case 2: \( n \) is a composite number.**
   - Let \( n = \prod_{i=1}^L p_i^{e_i} \), where \( p_1 < p_2 < \cdots < p_L \) are primes.
   - We have:
     \[
     \varphi(n) = n \prod_{i=1}^L \left(1 - \frac{1}{p_i}\right)
     \]
   - Substituting into the equation, we get:
     \[
     n \prod_{i=1}^L \left(1 - \frac{1}{p_i}\right) = 2n^{\ell - 2k}
     \]
   - Simplifying, we obtain:
     \[
     \prod_{i=1}^L \left(1 - \frac{1}{p_i}\right) = 2n^{\ell - 2k - 1}
     \]

6. **Subcase: \( n \) is a power of 2.**
   - If \( n = 2^e \), then \( \varphi(2^e) = 2^e (1 - \frac{1}{2}) = 2^{e-1} \).
   - Substituting into the equation, we get:
     \[
     2^{e-1} = 2 \cdot 2^{e(\ell - 2k)}
     \]
     \[
     2^{e-1} = 2^{1 + e(\ell - 2k)}
     \]
     \[
     e-1 = 1 + e(\ell - 2k)
     \]
     \[
     e-2 = e(\ell - 2k)
     \]
     \[
     \ell - 2k = 1 - \frac{2}{e}
     \]
   - Testing small values of \( e \):
     - For \( e = 1 \), \( \ell - 2k = -1 \), which is not possible.
     - For \( e = 2 \), \( \ell - 2k = 0 \), i.e., \( \ell = 2k \). Thus, \( n = 4 \) is a solution with \( k = 1 \) and \( \ell = 1 \).

7. **Subcase: \( n \) is a product of distinct primes.**
   - Let \( n = 2p \), where \( p \) is an odd prime.
   - We have:
     \[
     \varphi(2p) = 2p \left(1 - \frac{1}{2}\right)\left(1 - \frac{1}{p}\right) = p-1
     \]
   - Substituting into the equation, we get:
     \[
     p-1 = 2(2p)^{\ell - 2k}
     \]
   - This equation must hold for some \( k \) and \( \ell \). Testing small primes:
     - For \( n = 6 \):
       \[
       6-1 = 2 \cdot 6^{\ell - 2k} \implies 5 = 2 \cdot 6^{\ell - 2k}
       \]
       This is not possible since \( 6^{\ell - 2k} \) cannot be a fraction.

8. From the above cases, we find that the only solutions are \( n = 2, 3, 4, 6 \).

The final answer is \( \boxed{ n = 2, 3, 4, 6 } \)