Step 1: Find the limits at \( x = 2 \)
For \( x<2 \): \[ f(x) = \frac{x - 2}{|x - 2|} + a = -1 + a. \] For \( x>2 \): \[ f(x) = \frac{x - 2}{|x - 2|} + b = 1 + b. \] At \( x = 2 \): \[ f(x) = a + b. \]
Step 2: Set up the continuity condition
For \( f(x) \) to be continuous at \( x = 2 \): \[ \lim_{x \to 2^-} f(x) = \lim_{x \to 2^+} f(x) = f(2). \] Substitute the values: \[ -1 + a = 1 + b = a + b. \] Step 3: Solve for \( a \) and \( b \)
From \( -1 + a = 1 + b \): \[ a - b = 2. \] From \( 1 + b = a + b \): \[ a = 1. \] Substitute \( a = 1 \) into \( a - b = 2 \): \[ 1 - b = 2 \implies b = -1. \] Step 4: Conclude the result
The values of \( a \) and \( b \) are \( a = 1 \) and \( b = -1 \).