20-05-2024

    Problem: Discuss the continuity of the function \[ f(x) = \begin{cases} \cos \left( \frac{1}{x} \right) , &\text{ if } x \neq 0 ;\\ 0, &\text{ if } x = 0. \end{cases} \]
Solution: It is clear that the function is continuous away from zero (as $\cos $ and $\frac{1}{x}$ both are continuous away from zero). We will prove that $f$ is not continuous at $x = 0$. For that let us use the sequential criteria for continuity. We know that if $f$ is a continuous function at $x$, then for every sequence $(x_n)$ if $x_n \rightarrow 0$, then $f(x_n) \rightarrow f(0).$ Consider the sequence \[ x_n = \frac{1}{2\pi n}, \ n\in \mathbb{N} \implies x_n \to 0. \] Now consider the sequence $f(x_n)$. \begin{align*} f(x_n) = \cos \left( \frac{1}{x_n} \right) = \cos (2\pi n) = 1 \neq f(0). \end{align*} Thus, the function is not continuos at $x = 0$.
We can not make the given function continuous at $x = 0$. For example, if we choose $x_n = \frac{1}{\pi n}$ which converges to $0$, then the sequence \[ f(x_n) = \cos \left( \frac{1}{x_n} \right) = \cos (\pi n) = (-1)^n. \] The above sequence is divergent. Therefore, whatever be the value of $f(0)$, the function will not be continuos at $x = 0$.