Let $a$ be a real number. Find all real-valued functions $f$ such that
$$\int f(x)^{a} dx=\left( \int f(x) dx \right)^{a}$$
when constants of integration are suitably chosen.
To solve the problem, we need to find all real-valued functions \( f \) such that 
\[ \int f(x)^a \, dx = \left( \int f(x) \, dx \right)^a \]
for a given real number \( a \), when constants of integration are suitably chosen.

1. **Case \( a = 0 \)**:
   - If \( a = 0 \), the equation becomes:
     \[ \int f(x)^0 \, dx = \left( \int f(x) \, dx \right)^0 \]
     Simplifying, we get:
     \[ \int 1 \, dx = 1 \]
     This is clearly not true since the left-hand side is \( x + C \) (where \( C \) is a constant of integration) and the right-hand side is always 1. Therefore, there is no solution for \( a = 0 \).

2. **Case \( a \neq 0 \)**:
   - Let \( F(x) = \int f(x) \, dx \). Then the given equation can be rewritten as:
     \[ \int f(x)^a \, dx = F(x)^a \]
   - Differentiating both sides with respect to \( x \), we get:
     \[ f(x)^a = a F(x)^{a-1} f(x) \]
   - Assuming \( f(x) \neq 0 \), we can divide both sides by \( f(x) \):
     \[ f(x)^{a-1} = a F(x)^{a-1} \]
   - If \( a = 1 \), this simplifies to:
     \[ f(x)^0 = 1 \]
     which is always true. Therefore, any function \( f(x) \) is a solution when \( a = 1 \).

3. **Case \( a \neq 1 \)**:
   - For \( a \neq 1 \), we can rewrite the equation as:
     \[ f(x)^{a-1} = a F(x)^{a-1} \]
   - This implies that \( f(x) \) is proportional to \( F(x) \):
     \[ f(x) = k F(x) \]
     where \( k \) is a constant. Integrating both sides, we get:
     \[ F(x) = \int f(x) \, dx = \int k F(x) \, dx \]
     \[ F(x) = k \int F(x) \, dx \]
   - This is a differential equation. Let \( F(x) = g(x) \), then:
     \[ g(x) = k \int g(x) \, dx \]
   - Differentiating both sides with respect to \( x \), we get:
     \[ g'(x) = k g(x) \]
   - This is a first-order linear differential equation. The general solution is:
     \[ g(x) = Ce^{kx} \]
     where \( C \) is a constant. Therefore:
     \[ F(x) = Ce^{kx} \]
     and since \( f(x) = k F(x) \):
     \[ f(x) = k Ce^{kx} \]

4. **Conclusion**:
   - For \( a = 1 \), any function \( f(x) \) is a solution.
   - For \( a \neq 1 \), the solution is \( f(x) = k Ce^{kx} \).

The final answer is \( \boxed{ f(x) = k Ce^{kx} } \) for \( a \neq 1 \) and any function \( f(x) \) for \( a = 1 \).