To find \( g(7) \) for the function \( g(x) = \sqrt{(x - 1)^2} \), we first need to substitute \( x = 7 \) into the function.
-
Calculate \( x - 1 \): \[ 7 - 1 = 6 \]
-
Now substitute this value into the function: \[ g(7) = \sqrt{(6)^2} \]
-
Calculate \( (6)^2 \): \[ (6)^2 = 36 \]
-
Now take the square root: \[ g(7) = \sqrt{36} = 6 \]
Thus, the value of \( g(7) \) is \( 6 \).
The correct answer is \( \text{D. } 6 \).