Keep original inputs whose graph heights satisfy 2≤g(x)≤6. On the rising segment, the straight-line rule is g(x)=2x+8.
2≤2x+8≤6
Subtract 8 and divide by 2 to obtain −3≤x≤−1. On the falling segment, g(x)=8−2x.
2≤8−2x≤6
Subtract 8 and divide by −2, reversing both inequality signs, to obtain 1≤x≤3. Both intervals lie in the graph's original domain, so the composite domain is [−3,−1]∪[1,3].