Consider the limit
$$\lim_{x \to 0} \cos\left(\frac{1}{x}\right)$$
Sorry if this is the wrong way to format functions like this. Is there an analytic way to solve questions like these other than "informally noticing a pattern and making a deduction"? (e.g. "noticing" that the cos function oscillates endlessly as $x$ approaches $0$ so the limit does not exist)
I tried using the rule that $\lim_{x \to a} f(g(x)) = f(\lim_{x \to a} g(x))$ if $f(x)$ is continuous, so:
$$\cos\left(\lim_{x \to 0} \frac{1}{x}\right) = \cos\left(\infty\right) $$
Which I suspect is wrong somehow because technically infinity isn't a number we can plug into the cos function so I don't know if I did something wrong or how else you're supposed to solve this.
Is my understanding of the composite-function rule for limits incorrect? Did I apply it incorrectly?
What's the correct way to solve this limit analytically?
Set $y= 1/x: $
Consider $x \rightarrow 0^+:$
Then $ y \lim \rightarrow +\infty$,and we have
$\lim_{ y\rightarrow +\infty} \cos(y).$
Choose sequences:
$1) y_n= π/2 +2πn ;$
$2) y_n = 2πn ;$
1) $a_n: = \cos (π/2+2πn)=0.$
2) $b_n:= \cos(2πn) = 1.$
Limits:
1)$\lim_{n \rightarrow \infty}a_n= 0.$
2)$\lim{n \rightarrow \infty} b_n=1.$
Hence limit does not exist.