Let $f(x)=x^2-kx+(k-1)^2$ for some constant $k$. What is the largest possible real value of $k$ such that $f$ has at least one real root?

[i]2020 CCA Math Bonanza Individual Round #5[/i]
1. **Identify the discriminant of the quadratic function:**
   The given quadratic function is \( f(x) = x^2 - kx + (k-1)^2 \). For a quadratic equation \( ax^2 + bx + c = 0 \), the discriminant \( \Delta \) is given by:
   \[
   \Delta = b^2 - 4ac
   \]
   Here, \( a = 1 \), \( b = -k \), and \( c = (k-1)^2 \). Substituting these values into the discriminant formula, we get:
   \[
   \Delta = (-k)^2 - 4 \cdot 1 \cdot (k-1)^2
   \]
   Simplifying this, we have:
   \[
   \Delta = k^2 - 4(k-1)^2
   \]

2. **Simplify the discriminant expression:**
   Expand and simplify the expression for the discriminant:
   \[
   \Delta = k^2 - 4(k^2 - 2k + 1)
   \]
   \[
   \Delta = k^2 - 4k^2 + 8k - 4
   \]
   \[
   \Delta = -3k^2 + 8k - 4
   \]

3. **Determine the condition for real roots:**
   For the quadratic function \( f(x) \) to have at least one real root, the discriminant must be non-negative:
   \[
   \Delta \geq 0
   \]
   Therefore, we need to solve:
   \[
   -3k^2 + 8k - 4 \geq 0
   \]

4. **Solve the inequality:**
   First, solve the equality \( -3k^2 + 8k - 4 = 0 \) to find the critical points. This is a quadratic equation in \( k \):
   \[
   -3k^2 + 8k - 4 = 0
   \]
   Using the quadratic formula \( k = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \), where \( a = -3 \), \( b = 8 \), and \( c = -4 \):
   \[
   k = \frac{-8 \pm \sqrt{8^2 - 4(-3)(-4)}}{2(-3)}
   \]
   \[
   k = \frac{-8 \pm \sqrt{64 - 48}}{-6}
   \]
   \[
   k = \frac{-8 \pm \sqrt{16}}{-6}
   \]
   \[
   k = \frac{-8 \pm 4}{-6}
   \]
   This gives us two solutions:
   \[
   k = \frac{-8 + 4}{-6} = \frac{-4}{-6} = \frac{2}{3}
   \]
   \[
   k = \frac{-8 - 4}{-6} = \frac{-12}{-6} = 2
   \]

5. **Analyze the inequality:**
   The quadratic \( -3k^2 + 8k - 4 \) opens downwards (since the coefficient of \( k^2 \) is negative). Therefore, the inequality \( -3k^2 + 8k - 4 \geq 0 \) holds between the roots \( \frac{2}{3} \) and \( 2 \):
   \[
   \frac{2}{3} \leq k \leq 2
   \]

6. **Determine the largest possible value of \( k \):**
   The largest possible real value of \( k \) within this interval is \( k = 2 \).

The final answer is \( \boxed{2} \).