Step1: Analyze the first piece ($x \leq -1$)
The first part of the function is $f(x) = 2$ when $x \leq -1$. This is a horizontal line. We can plot a closed dot (since $x = -1$ is included) at $(-1, 2)$ and draw a horizontal line to the left (for all $x$ values less than or equal to -1).
Step2: Analyze the second piece ($-1 < x \leq 1$)
The second part is $f(x) = -x + 1$ for $-1 < x \leq 1$. This is a linear function. Let's find two points:
- When $x = -1$ (but not included, so open dot), $f(-1) = -(-1) + 1 = 2$. Wait, but at $x = -1$, the first piece is 2 (closed dot), and the second piece at $x = -1$ would be 2 (open dot). So at $x = -1$, the closed dot from the first piece is there.
- When $x = 1$ (included, closed dot), $f(1) = -1 + 1 = 0$. So we have a closed dot at $(1, 0)$ and an open dot at $(-1, 2)$ (but the first piece already has a closed dot there, so the second piece starts with an open dot at $(-1, 2)$ and goes to $(1, 0)$.
Step3: Analyze the third piece ($x > 1$)
The third part is $f(x) = 3$ when $x > 1$. This is a horizontal line. We plot an open dot at $(1, 3)$ (since $x = 1$ is not included here) and draw a horizontal line to the right (for all $x$ values greater than 1).
Now, to sketch the graph:
- For $x \leq -1$: Horizontal line at $y = 2$, closed dot at $(-1, 2)$.
- For $-1 < x \leq 1$: Line from open dot $(-1, 2)$ (but the first piece has a closed dot there, so the second piece starts with an open dot, but visually, since the first piece is already at $(-1, 2)$, we can draw the line from $(-1, 2)$ (treating it as an open dot for the second piece, but the first piece's closed dot is there) to $(1, 0)$ (closed dot).
- For $x > 1$: Horizontal line at $y = 3$, open dot at $(1, 3)$.