Question: Suppose that the function $g$ is defined, for all real numbers, as follows.
g(x) = \{
1 \text{ if } x < 0
-2 \text{ if } x = 0
-1 \text{ if } x > 0
\}
Graph the function $g$.
Graph: a horizontal line at $y = 1$ for $x < 0$ with an open circle at $(0, 1)$; an open circle at $(0, -1)$ for $x > 0$; and a filled point at $(0, -2)$. position_hint: center
1. **State the problem:** We need to graph the piecewise function $$g(x) = \begin{cases} 1 & \text{if } x < 0 \\ -2 & \text{if } x = 0 \\ -1 & \text{if } x > 0 \end{cases}$$
2. **Understand the function:** The function $g$ takes different constant values depending on whether $x$ is less than, equal to, or greater than zero.
3. **Graph for $x < 0$:** The function value is $1$. This means for all $x$ less than zero, $g(x) = 1$. We draw a horizontal line at $y=1$ for $x<0$.
4. **Open circle at $(0,1)$:** Since the function is not defined as $1$ at $x=0$, we place an open circle at $(0,1)$ to indicate the value is not included there.
5. **Value at $x=0$:** The function value is $-2$. We plot a filled point at $(0,-2)$ to show the function value at zero.
6. **Graph for $x > 0$:** The function value is $-1$. For all $x$ greater than zero, $g(x) = -1$. We draw a horizontal line at $y=-1$ for $x>0$.
7. **Open circle at $(0,-1)$:** Since the function is not defined as $-1$ at $x=0$, we place an open circle at $(0,-1)$.
**Final graph description:**
- Horizontal line at $y=1$ for $x<0$ with an open circle at $(0,1)$.
- Filled point at $(0,-2)$.
- Horizontal line at $y=-1$ for $x>0$ with an open circle at $(0,-1)$.
This completes the graph of the piecewise function $g$.