bash, 5656 54 38 bytes
[ -z $3 ]&&echo T||]||([ $1 != $3 ]&&echo F||(($1==$3))&&(shift;$0 $*))
Save this as a script, and pass the list of numbers as arguments (for an n-element list, you'll pass n arguments). The output is Tthe exit code: 0 (for true) if the list is alternating, and F1 (for false) otherwise.
(Returning output in the exit code is allowed in the PPCG standard I/O methods.)
This works recursively:
- If the list has fewer than 3 elements, then print T;exit with return code 0;
- else if the 1st element != the 3rd element, then print F;exit with return code 1;
- else run the program recursively on the list with the first element removed.