A particle moves along the $x$-axis.  It collides elastically head-on with  an identical particle initially at rest. Which of the following graphs could illustrate the momentum of each particle as a function of time? 

[asy]
size(400);
pen dps = linewidth(0.7) + fontsize(10); defaultpen(dps);
draw((0,0)--(0,5));
draw((0,1.5)--(5,1.5));
label("$p$",(0,5),N);
label("$t$",(5,1.5),E);
label("$\mathbf{(A)}$",(2.5,-0.5));
draw((0,1.5)--(2.5,1.5)--(2.5,0.75)--(4,0.75),black+linewidth(2));
draw((0,3.5)--(2.5,3.5)--(2.5,4.25)--(4,4.25),black+linewidth(2));

draw((8,0)--(8,5));
draw((8,1.5)--(13,1.5));
label("$p$",(8,5),N);
label("$t$",(13,1.5),E);
label("$\mathbf{(B)}$",(10.5,-0.5));
draw((8,1.5)--(10.5,1.5)--(10.5,2.5)--(12,2.5),black+linewidth(2));
draw((8,3.5)--(10.5,3.5)--(10.5,4.5)--(12,4.5),black+linewidth(2));

draw((16,0)--(16,5));
draw((16,1.5)--(21,1.5));
label("$p$",(16,5),N);
label("$t$",(21,1.5),E);
label("$\mathbf{(C)}$",(18.5,-0.5));
draw((16,1.5)--(18.5,1.5)--(18.5,2.25)--(20,2.25),black+linewidth(2));
draw((16,3.5)--(18.5,3.5)--(18.5,2.75)--(20,2.75),black+linewidth(2));

draw((24,0)--(24,5));
draw((24,1.5)--(29,1.5));
label("$p$",(24,5),N);
label("$t$",(29,1.5),E);
label("$\mathbf{(D)}$",(26.5,-0.5));
draw((24,1.5)--(26.5,1.5)--(26.75,3.25)--(28,3.25),black+linewidth(2));
draw((24,3.25)--(26.5,3.25)--(26.75,1.5)--(28,1.5),black+linewidth(2));
draw((32,0)--(32,5));
draw((32,1.5)--(37,1.5));
label("$p$",(32,5),N);
label("$t$",(37,1.5),E);
label("$\mathbf{(E)}$",(34.5,-0.5));
draw((32,1.5)--(34.5,1.5)--(34.5,0.5)--(36,0.5),black+linewidth(2));
draw((32,3.5)--(34.5,3.5)--(34.5,2.75)--(36,2.75),black+linewidth(2));
[/asy]
1. **Understanding the problem**: We need to determine which graph correctly represents the momentum of two identical particles during an elastic head-on collision. One particle is initially moving, and the other is at rest.

2. **Conservation of Momentum**: In an elastic collision, both momentum and kinetic energy are conserved. For two identical particles, the velocities are exchanged after the collision. If particle 1 has initial momentum \( p_1 \) and particle 2 is at rest (momentum \( p_2 = 0 \)), after the collision, particle 1 will be at rest and particle 2 will have momentum \( p_1 \).

3. **Graph Analysis**:
    - **Graph (A)**: Shows one particle's momentum dropping to half and the other increasing to half. This does not conserve momentum correctly.
    - **Graph (B)**: Shows one particle's momentum increasing and the other decreasing, but not switching places.
    - **Graph (C)**: Shows one particle's momentum increasing and the other decreasing, but not switching places.
    - **Graph (D)**: Shows the momentum of the initially moving particle dropping to zero and the initially stationary particle gaining the same momentum. This correctly represents the particles switching places.
    - **Graph (E)**: Shows one particle's momentum dropping to a lower value and the other increasing to a lower value, which does not conserve momentum correctly.

4. **Conclusion**: The correct graph is (D), as it shows the momentum of the initially moving particle dropping to zero and the initially stationary particle gaining the same momentum, indicating they have switched places.

The final answer is $\boxed{\textbf{(D)}}$