Well, you need two linearly independent solutions of the equation of motion
$$m \ddot{x}=F \; \Rightarrow \; \ddot{x}=-\omega^2 x$$
(BTW you forgot the ##x## in your force formula).
You can use any two linearly independent solutions. Obviously your two functions will do. The general solution of the equation of motion is given by all possible linear combinations, i.e.,
$$x(t)=A \exp(\mathrm{i} \omega t) + B \exp(-\mathrm{i} \omega t).$$
Obviously also ##\cos(\omega t)## and ##\sin(\omega t)## solve the equations, and since they are linearly independent the complete solution is also given as superpositions of them, i.e., also
$$x(t)=A' \cos(\omega t) + B' \sin(\omega t)$$
give the complete set of solutions.
You can make the solution unique by assuming the appropriate initial conditions, which is of course the natural thing for a typical mechanics problem: You need to give the position and velocity of the particle at some initial time, say ##t=0##, i.e., you give the values ##x(0)=x_0## and ##\dot{x}(0)=v_0##. Now you can use both superpositions to evaluate the now unique solution ##x(t)## for these initial conditions. You'll see that of course you get the same result.
Another way to see this is to express the one set of linearly independent functions in terms of the other. For that just remember how cos and sin are expressed in terms of exponential functions or use Euler's formula to derive them.