A [i]repunit[/i] is a positive integer whose digits in base $ 10$ are all ones. Find all polynomials $ f$ with real coefficients such that if $ n$ is a repunit, then so is $ f(n).$
1. **Define the Problem and Initial Setup:**
   A repunit is a number consisting entirely of ones in base 10. We need to find all polynomials \( f \) with real coefficients such that if \( n \) is a repunit, then \( f(n) \) is also a repunit.

2. **Form of Repunit:**
   A \( k \)-digit repunit can be expressed as:
   \[
   R_k = \frac{10^k - 1}{9}
   \]
   where \( k \) is the number of digits.

3. **Proposed Polynomial Form:**
   We propose that the polynomial \( f \) that maps repunits to repunits has the form:
   \[
   f_{m,r}(x) = \frac{10^r (9x + 1)^m - 1}{9}
   \]
   where \( m \) is a nonnegative integer and \( r \ge 1 - m \).

4. **Verification of the Polynomial:**
   To verify, we substitute \( x = R_k \) into \( f_{m,r}(x) \):
   \[
   f_{m,r}\left( \frac{10^k - 1}{9} \right) = \frac{10^r \left( 9 \cdot \frac{10^k - 1}{9} + 1 \right)^m - 1}{9}
   \]
   Simplifying inside the parentheses:
   \[
   9 \cdot \frac{10^k - 1}{9} + 1 = 10^k
   \]
   Thus,
   \[
   f_{m,r}\left( \frac{10^k - 1}{9} \right) = \frac{10^r (10^k)^m - 1}{9} = \frac{10^{mk + r} - 1}{9}
   \]
   This is indeed a repunit with \( mk + r \) digits.

5. **Uniqueness of the Polynomial:**
   We need to show that these are the only polynomials that map repunits to repunits. Assume \( f \) is a polynomial of degree \( d \):
   \[
   f(x) = a_d x^d + a_{d-1} x^{d-1} + \cdots + a_0
   \]
   For large \( k \), the leading term dominates, so:
   \[
   \log(f(x)) \approx d \log x + \log a_d
   \]
   Applying this to \( x = R_k \):
   \[
   \log\left( f\left( \frac{10^k - 1}{9} \right) \right) \approx d \log\left( \frac{10^k - 1}{9} \right) + \log a_d
   \]
   Since \( \log\left( \frac{10^k - 1}{9} \right) \approx k \log 10 \):
   \[
   \log(f(R_k)) \approx d k \log 10 + \log a_d
   \]
   We want this to be the logarithm of a repunit:
   \[
   \log\left( \frac{10^{g(k)} - 1}{9} \right) \approx g(k) \log 10
   \]
   Equating the two expressions:
   \[
   d k \log 10 + \log a_d \approx g(k) \log 10
   \]
   Thus,
   \[
   g(k) = d k + \frac{\log a_d}{\log 10}
   \]
   For \( g(k) \) to be an integer, \( \frac{\log a_d}{\log 10} \) must be an integer, say \( r \). Therefore:
   \[
   g(k) = d k + r
   \]
   Hence, \( f(x) \) must be of the form:
   \[
   f(x) = \frac{10^r (9x + 1)^d - 1}{9}
   \]
   where \( d \) is a nonnegative integer and \( r \ge 1 - d \).

6. **Conclusion:**
   The polynomials that map repunits to repunits are exactly those of the form:
   \[
   f_{m,r}(x) = \frac{10^r (9x + 1)^m - 1}{9}
   \]
   where \( m \) is a nonnegative integer and \( r \ge 1 - m \).

The final answer is \( \boxed{ f_{m,r}(x) = \frac{10^r (9x + 1)^m - 1}{9} } \) where \( m \) is a nonnegative integer and \( r \ge 1 - m \).