I think what you want to do is navigate to Data>Indentify Duplicate Cases and select your ID variable to identify duplicates by.
Do this twice, first time around let it run with default settings, a variable named "PrimaryLast" is appended to your dataset. for the second run select the first case of the ID to be primary, a variable "PrimaryFirst" is appended.
Now you have the beginning and the end of the data for each case denoted by those variables
Alternatively, this syntax should also do the trick:
sort cases by ID(a).
compute x1 = lag(ID).
create x2 = lead(ID,1).
recode x1 x2 (sysmis=0).
if x1 <> ID first = 1.
if x2 <> ID last = 1.
The lag function "pushes down" your ID values one cell in a new variable, the lead function "pushes them up", so wherever theres a divergence between x1 and the ID or x2 and the ID is the first or last ID respectively.