I just want to check whether these proofs are correct. The problem goes as follow.
Given
$$g(x) = \begin{cases} \sin\frac{1}{x} & x>0 \\ 1 & x\leq 0 \\ \end{cases},$$
prove that $g(x)$ is discontinuous at the point $x_0=0$ through:
(a) the sequence definition of continuity
Proof for (a)
Let $x_n = \frac1n$. Then $x_n$ converges to $0$, but $g(x_n)=\sin\left(\frac{1}{\frac1n}\right)=\sin(n)$ which diverges to infinity. It follows that $g(x_n)$ does not converge to $g(0)=1$. So $g(x)$ is not continuous at $x_0 = 0$.
(b) the $\varepsilon$-$\delta$ definition of continuity.
Proof for (b)
Pick $\varepsilon > \frac12$. Then there is no $\delta$ that works, because for any $\delta$, we can pick $x = \frac\delta2$, and then $|x-0|=\frac\delta2<\delta$ but $|g(x)-g(x_0)|=|\sin(\frac1x)-1|=1$ which is not less than $\varepsilon$.
I'm stuck in proof b because I don't understand how $|g(x)-g(x_0)|$ can be less than $\varepsilon$ when $g(x_0) = -1$.
Any help is much appreciated.
How do you know that $\sin n$ diverges to $\infty$? Take $x_n=\frac 1 {n\pi}$ instead of $\frac 1 n$ for part a). Since $\sin (n\pi)=0$ we get a contradiction to continuity. For part b) suppose $|f(x)-1| <\frac 1 2$ for $|x| <\delta$. Take $x=\frac 1 {n\pi}$ to get a contardiction.