<s>[INST] Proving that $g(x)$ defined as $x^2$ on the rationals and $x^4$ on irrationals, is discontinuous at $2$ 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
 [/INST] Rather than $x^4 > 3$, instead conclude that $x^4 < 5$, or equivalently,
$$-\sqrt[4]{5} < x < \sqrt[4]{5}.$$
If you had chosen instead an irrational $x$ such that
$$2 - \min\{\delta, 2 - \sqrt[4]{5}\} < x < 2,$$
then you'd have $x > 2 - (2 - \sqrt[4]{5}) = \sqrt[4]{5}$, a contradiction.
</s>