4. As shown in Figure 2, given the function $y=2 x^{2}$ on $[a, b]$ $(a<b)$, the range of values is $[0,2]$. Then the trajectory of point $(a, b)$ is ( ).
(A) line segments $A B, B C$
(B) line segments $A B, O C$
(C) line segments $O A, B C$
(D) line segments $O A, O C$
4. A.

From $y=2 x^{2} \geqslant 0$, we know that when $y=0$, $x=0$. Therefore, $0 \in [a, b]$. Also, when $y=2$, $x=1$ or $x=-1$. There are two possibilities:
(1) If $1 \in [a, b]$, then by $a<b$ and the monotonicity of the function on $\mathbf{R}^{+}$, we have $b=1$, and $-1 \leqslant a \leqslant 0$. The corresponding trajectory is the line segment $A B$.
(2) If $-1 \in [a, b]$, then by $a<b$, and the monotonicity of the function on $\mathbf{R}^{-}$, we have $a=-1$, and $0 \leqslant b \leqslant 1$. The corresponding trajectory is the line segment $B C$.