Define $g: \mathbb{R} \to \mathbb{R}$ by $$g(x) =\begin{cases} x^2 & \text{if } x \text{ is rational}, \\\\ x^4 & \text{if } x \text{ is irrational}. \end{cases}$$ Prove that $g$ is discontinuous at $x = 2$.
Solution Attempt:
Assume instead that $g$ is continuous at 2. Then since $g(2)= 4$, $\;\;\displaystyle \lim_{x\to2}g(x)=4$;
so taking $\epsilon=1$, there is a $\delta>0$ such that if $0<|x-2|<\delta$, then $\big|g(x)-4\big|<1$.
Therefore if $x$ is irrational and $2-\delta<x<2$, then $\big|x^4-4\big|<1$
$-1 <x^4-4<1\implies 3<x^4<5\implies x^4>3 \implies x = 3^\frac{1}{4} \implies x < 2$ Contradiction