To solve the problem, we need to define the function \( f(f(x)) \) based on the given piecewise function \( f(x) \) and then determine its domain and range.
### Step 1: Define the function \( f(x) \)
The function \( f(x) \) is defined as follows:
\[
f(x) =
\begin{cases}
1 + x & \text{if } 0 \leq x \leq 1 \\
3 - x & \text{if } x > 1
\end{cases}
\]
### Step 2: Determine \( f(f(x)) \)
We will evaluate \( f(f(x)) \) by considering the two cases for \( f(x) \).
#### Case 1: \( 0 \leq x \leq 1 \)
In this case, \( f(x) = 1 + x \). We need to find the range of \( 1 + x \):
- When \( x = 0 \), \( f(x) = 1 \).
- When \( x = 1 \), \( f(x) = 2 \).
Thus, for \( 0 \leq x \leq 1 \), \( f(x) \) ranges from \( 1 \) to \( 2 \).
Now we need to evaluate \( f(f(x)) = f(1 + x) \):
- Since \( 1 + x \) falls within the range \( [1, 2] \), we apply the second case of \( f(x) \):
\[
f(1 + x) = 3 - (1 + x) = 2 - x
\]
So, for \( 0 \leq x \leq 1 \):
\[
f(f(x)) = 2 - x
\]
#### Case 2: \( x > 1 \)
In this case, \( f(x) = 3 - x \). We need to find the range of \( 3 - x \):
- As \( x \) increases beyond \( 1 \), \( 3 - x \) decreases:
- When \( x = 1 \), \( f(x) = 2 \).
- As \( x \to \infty \), \( f(x) \to -\infty \).
Thus, for \( x > 1 \), \( f(x) \) ranges from \( 2 \) to \( -\infty \).
Now we need to evaluate \( f(f(x)) = f(3 - x) \):
- Since \( 3 - x < 2 \) for \( x > 1 \), we apply the first case of \( f(x) \):
\[
f(3 - x) = 1 + (3 - x) = 4 - x
\]
So, for \( x > 1 \):
\[
f(f(x)) = 4 - x
\]
### Step 3: Combine the results
We have:
\[
f(f(x)) =
\begin{cases}
2 - x & \text{if } 0 \leq x \leq 1 \\
4 - x & \text{if } x > 1
\end{cases}
\]
### Step 4: Determine the domain of \( f(f(x)) \)
The domain of \( f(f(x)) \) is the same as the domain of \( f(x) \), which is \( [0, \infty) \).
### Step 5: Determine the range of \( f(f(x)) \)
- For \( 0 \leq x \leq 1 \):
- The minimum value occurs at \( x = 1 \): \( f(f(1)) = 1 \).
- The maximum value occurs at \( x = 0 \): \( f(f(0)) = 2 \).
- Thus, the range for this case is \( [1, 2] \).
- For \( x > 1 \):
- As \( x \to 1 \), \( f(f(1)) = 1 \).
- As \( x \to \infty \), \( f(f(x)) \to -\infty \).
- Thus, the range for this case is \( (-\infty, 3) \).
Combining both ranges, the overall range of \( f(f(x)) \) is \( (-\infty, 2] \).
### Final Result
- **Function**:
\[
f(f(x)) =
\begin{cases}
2 - x & \text{if } 0 \leq x \leq 1 \\
4 - x & \text{if } x > 1
\end{cases}
\]
- **Domain**: \( [0, \infty) \)
- **Range**: \( (-\infty, 2] \)