Here's the problem:
Consider the function $f(x)=\text{cos}(\sqrt{x}e^x)$. Show that there exists a number $\alpha$ and a sequence of positive integers $a_1, a_2, a_3,...$ such that
$$ \lvert f(a_1)-\alpha \rvert \lt 1, \lvert f(a_2)-\alpha \rvert \lt \frac{1}2,\lvert f(a_3)-\alpha \rvert \lt \frac{1}3,... $$
(Hint: remember the definition of sequential compactness and apply it to $[-1,1]$.)
Here is the definition of sequential compactness from my lecture notes: "A set $S \subset \Bbb R$ is sequentially compact if ANY sequence in $S$ has a subsequence converging to a point in $S$."
So, I know that a set is sequentially compact iff the set is closed and bounded. I also know that the outputs of the given function are all, obviously, within the interval $[-1,1]$. There's also this idea that a subsequence can be created that converges to a point in the set, but I don't think that that applies here. Basically, I'm pretty lost on this one, so any help would be appreciated.
Hint 1: what do you know about the sequence $(f(n))_{n=1}^{\infty}$?
Hint 2: note it says the definition of sequential compactness.
Hint 3: Recall the definition of convergence: a sequence $(f(n))$ converges to $\alpha$ if for any given $\varepsilon>0$, there is an $N$ such that $$ \left| f(n) - \alpha \right| < \varepsilon. $$
So, we have a convergent subsequence from compactness. First take $\varepsilon=1$, and choose the first term of your sequence that satisfies $$ \left| f(n) - \alpha \right| < 1, $$ and call this $a_1$. Now put $\varepsilon=1/2$...