Step 1: Think of the graph:
The graph is flat at height 2 up to $x = 3$ and flat at height 5 from $x = 5$.
The line $y = ax + b$ must join these two flat parts without a jump.
Step 2: Use the two joining points:
The line must pass through $(3, 2)$ and through $(5, 5)$.
This gives $3a + b = 2$ and $5a + b = 5$.
Step 3: Find the slope:
The slope of the line through the two points is the value of $a$.
\[ a = \frac{5 - 2}{5 - 3} = \frac{3}{2} \]
Step 4: Find the intercept:
Use the point $(3, 2)$: $2 = \frac{3}{2}(3) + b$.
\[ b = 2 - \frac{9}{2} = -\frac{5}{2} \]
Step 5: Check the other point:
At $x = 5$: $\frac{3}{2}(5) - \frac{5}{2} = \frac{15 - 5}{2} = 5$. This matches.
Final Answer:
\[ \boxed{a = \frac{3}{2}, \quad b = -\frac{5}{2}} \]