Let \[f(x) = \left\{
\begin{array}{cl}
-x + 3 & \text{if } x \le 0, \\
2x - 5 & \text{if } x > 0.
\end{array}
\right.\]How many solutions does the equation $f(f(x)) = 4$ have?
To solve the equation $f(f(x)) = 4,$ we first find the values $x$ such that $f(x) = 4.$

Either $f(x) = -x + 3$ (for $x \le 0$) or $f(x) = 2x - 5$ (for $x > 0$). If $-x + 3 = 4,$ then $x = -1.$ Note that this value satisfies $x \le 0.$ If $2x - 5 = 4,$ then $x = 9/2.$ Note that this value satisfies $x > 0.$ Therefore, the solutions to $f(x) = 4$ are $x = -1$ and $x = 9/2.$

Next, we solve for the values $x$ such that $f(x) = -1.$ If $-x + 3 = -1,$ then $x = 4.$ This value does not satisfy $x \le 0.$ If $2x - 5 = -1,$ then $x = 2.$ This value satisfies $x > 0.$

Finally, we solve for the values $x$ such that $f(x) = 9/2.$ If $-x + 3 = 9/2,$ then $x = -3/2.$ This value satisfies $x \le 0.$ If $2x - 5 = 9/2,$ then $x = 19/4.$ This value satisfies $x > 0.$

Therefore, the equation $f(f(x)) = 4$ has the solutions $x = 2,$ $-3/2,$ and $19/4,$ for a total of $\boxed{3}$ solutions.
3
Level 5
Algebra
Problem: Let \[f(x) = \left\{
\begin{array}{cl}
-x + 3 & \text{if } x \le 0, \\
2x - 5 & \text{if } x > 0.
\end{array}
\right.\]How many solutions does the equation $f(f(x)) = 4$ have?
Solution:<|START_OF_LATENT|><|PRIOR_PREFIX|>To determine the number of solutions to the equation \( f(f(x)) = 4 \), we first need to analyze the function \( f(x) \) defined in piecewise form. 

1. Identify the outputs of \( f(x) \):
   - For \( x \le 0 \), \( f(x) = -x + 3 \).
   - For \( x > 0 \), \( f(x) = 2x - 5 \).

2. Calculate \( f(f(x)) \) for both cases of \( x \).

**Case 1: \( x \le 0 \)**
- Here, \( f(x) = -x + 3 \). We need to determine if \( -x + 3 \) is less than or equal to 0 or greater than 0 to find \( f(f(x)) \).
- Solve \( -x + 3 \le 0 \) to find \( x \ge 3 \). Since \( x \le 0 \), this condition is never satisfied. Thus, \( -x + 3 > 0 \) for all \( x \le 0 \).
- Therefore, we use the second piece of the function: \( f(f(x)) = f(-x + 3) = 2(-x + 3) - 5 = -2x + 6 - 5 = -2x + 1 \).

**Case 2: \( x > 0 \)**
- Here, \( f(x) = 2x - 5 \). We need to check if \( 2x - 5 \) is less than or equal to 0 or greater than 0.
- Solve \( 2x - 5 \le 0 \) to find \( x \le 2.5 \). For \( 0 < x \le 2.5 \), we use the first piece: \( f(f(x)) = f(2x - 5) = - (2x - 5) + 3 = -2x + 5 + 3 = -2x + 8 \).
- For \( x > 2.5 \), we use the second piece: \( f(f(x)) = f(2x - 5) = 2(2x - 5) - 5 = 4x - 10 - 5 = 4x - 15 \).

3. Set \( f(f(x)) = 4 \) for each case and solve for \( x \).

**From Case 1:**
- Solve \( -2x + 1 = 4 \):
  - \( -2x = 3 \)
  - \( x = -\frac{3}{2} \) (valid since \( x \le 0 \)).

**From Case 2:**
- For \( 0 < x \le 2.5 \), solve \( -2x + 8 = 4 \):
  - \( -2x = -4 \)
  - \( x = 2 \) (valid since \( 0 < 2 \le 2.5 \)).
  
- For \( x > 2.5 \), solve \( 4x - 15 = 4 \):
  - \( 4x = 19 \)
  - \( x = \frac{19}{4} = 4.75 \) (valid since \( 4.75 > 2.5 \)).

4. Count the valid solutions:
- From Case 1: 1 solution (\( x = -\frac{3}{2} \)).
- From Case 2: 2 solutions (\( x = 2 \) and \( x = 4.75 \)).

5. Total number of solutions is \( 1 + 2 = 3 \). 

The final answer is \( 3 \).<|END_OF_LATENT|> The final answer is $3$.