We need to find the value of \( x \) within the specified ranges where \( f(x) = 2 \).
- For \( x < 0 \), \( f(x) = x^2 \): Setting \( x^2 = 2 \) gives \( x = \pm \sqrt{2} \). However, only negative \( x \) values are applicable in this range, which does not contribute to the positive solution.
- For \( 0 \leq x \leq 2 \), \( f(x) = 5x - 3 \): Solving \( 5x - 3 = 2 \) yields: \[ 5x = 5 \implies x = 1 \] \( x = 1 \) is within the interval \( [0, 2] \) and satisfies \( f(x) = 2 \).
- For \( x > 2 \), \( f(x) = x^2 + 1 \): Solving \( x^2 + 1 = 2 \) results in: \[ x^2 = 1 \implies x = \pm 1 \] Only \( x = 1 \) fits this equation, but \( x \) must be greater than 2 in this range, so \( x = 1 \) is not valid here.
Thus, the correct and only positive \( x \) value for which \( f(x) = 2 \) under the constraints provided by the piecewise function is \( x = 1 \).
Therefore, the correct answer is Option D.