This is a problem from the textbook The Way of Analysis by Robert Strichartz. So all solutions to $x''(t)=-x(t)$ will have the general form $A\cos t+B\sin t$. Then the problem asks for which values of $t_1,t_2$ the ODE with boundary conditions $x(t_1)=a_1,x(t_2)=a_2$ has a unique solution on $[t_1,t_2]$ for any choices of $a_1,a_2$? I am stuck on how to think about this. I did some search and it seems like there is no general theorem for this and has to be done in a case-by-case style. Thanks!
You can simplify this question by writing the solution as $$ x(t)=a_1\cos(t-t_1)+B\sin(t-t_1). $$ Here the first boundary condition is automatically satisfied. For the second condition, you have to solve $$ a_2=x(t_2)=a_1\cos(t_2-t_1)+B\sin(t_2-t_1) $$ This is in general impossible if $\sin(t_2-t_1)=0$.