Example
Show that \(f\) is not continuous at \(x = 0\) where \(f\) is defined as $$ \begin{align} f(x) = \begin{cases} \frac{1}{x}, & \text{if } 0 < x \leq 1, \\ 0, & \text{if } x = 0. \end{cases} \end{align} $$

Proof 1

Note here that if \(f\) was defined as \(f(x) = \frac{1}{x}\), then we can’t really talk about continuity at \(x = 0\) since \(f\) is not even defined on \(x = 0\). To address this, we define \(f\) as the problem statement

$$ \begin{align} f(x) = \begin{cases} \frac{1}{x}, & \text{if } 0 < x \leq 1, \\ 0, & \text{if } x = 0. \end{cases} \end{align} $$

This function is defined on \(0\). We can now discuss continuity at \(x = 0\). We will show that \(f\) is not continuous at \(x = 0\). Take \(\epsilon_0 = 1\). Then for every \(\delta > 0\), we want to show that there exists some \(x \in [0,1]\) such that

$$ \begin{align} |x-0| < \delta \quad \text{ and } \quad |f(x)-f(0)| = \left|\frac{1}{x}\right| \geq \epsilon_0 = 1 \end{align} $$

To do this, consider the following cases:
Case 1: \(0 < \delta < \frac{1}{2}\). Then set

$$ \begin{align} x = \frac{\delta}{2} \end{align} $$

Then

$$ \begin{align} |x - 0| = |\frac{\delta}{2}| = \frac{\delta}{2} \leq \frac{1}{4} < 1 \quad \text{ so } x \in [0,1] \end{align} $$

Now observe that

$$ \begin{align*} \left| f(x) - f(0) \right| &= \left| \frac{1}{x} - 0 \right| = \left| \frac{1}{x} \right| = \frac{2}{\delta} \geq 4 > 1 = \epsilon_0. \end{align*} $$

Case 2: \(\delta > \frac{1}{2}\). Then set

$$ \begin{align} x = \frac{1}{4} \end{align} $$

Then

$$ \begin{align} |x - 0| = |\frac{1}{4}| = \frac{1}{4} < 1 \quad \text{ so } x \in [0,1] \end{align} $$

Now observe that

$$ \begin{align*} \left| f(x) - f(0) \right| &= \left| \frac{1}{x} - 0 \right| = \left| \frac{1}{x} \right| = 4 > 1 = \epsilon_0. \end{align*} $$

In both cases, we see that \(|f(x) - f(0)| > \epsilon_0\). Thus, \(f\) is not continuous at \(x = 0\). \(\ \blacksquare\)


Proof 2

Consider the sequence \(x_n = \frac{1}{n}\). \(x_n \in (0,1]\). Note that \(x_n\) approaches \(0\) as \(n\) approaches \(\infty\). But now

$$ \begin{align} f(x_n) = \frac{1}{x_n} \end{align} $$

However

$$ \begin{align} f(x_n) = n \to \infty \end{align} $$

So \(f(x_n)\) doesn’t converge as \(n \to \infty\). By the Sequential Characterization of Continuity, every sequence \(x_n\) such that \(x_n \to 0\), we must have \(f(x_n) \to f(0)\). Hence, \(f\) is not continuous at \(x = 0\). \(\ \blacksquare\)


References