Consider $A=[0,1]\cup[2,3]$ and $f : A \to \Bbb{R}$ which is defined as $f(x)=x^2,x∈[0,1]$ and $f(x)=x^3,x∈[2,3]$. Is $f$ continuous on $A$?
I have been asked to prove this using sequences. But I tried to prove this using the topological definition of continuity($\Bbb{R}$ is given the standard topology). Since it says that the preimage of a closed set should be closed, note that for $x \in [0,1], f(x) \in [0,1]$ and for $x\in [2,3] , f(x) \in [8,27]$.
So the range is $[0,1] \cup [8,27]$ if I take any closed set in this , it will also have a closed preimage.
For sequences: I can argue that since these sets are bounded, given $x\in [0,1]$ (WLOG), if a sequence $p_n $ converges to $x$, there must exist an $N$ such that for all $n>N$, $p_n$ lies in $[0,1]$. But how do I proceed after this ?
Can someone check these two arguments of mine.
Thanks in advance
It is clear that the functions $\operatorname{sq}, \operatorname{cb} : \mathbb{R} \to \mathbb{R}$ given by $\operatorname{sq}(x) = x^2$ and $\operatorname{cb}(x) = x^3$ are continuous.
Let $B$ be a closed set in $\mathbb{R}$.
We have:
\begin{align} f^{-1}(B) &= f^{-1}(B \cap ([0,1] \cup [8,27]))\\ &= f^{-1}((B \cap [0,1]) \cup (B \cap [8,27]))\\ &= f^{-1}(B \cap [0,1]) \cup f^{-1}(B \cap [8,27])\\ &= (\operatorname{sq}^{-1}(B) \cap [0,1]) \cup (\operatorname{cb}^{-1}(B) \cap [2,3]) \end{align}
Since $\operatorname{sq}$ and $\operatorname{cb}$ are continuous, we have that $\operatorname{sq}^{-1}(B)$ and $\operatorname{cb}^{-1}(B)$ are closed in $\mathbb{R}$, and so we conclude that $f^{-1}(B)$ is closed in $\mathbb{R}$.
In particular, $f^{-1}(B)$ is closed in $A$ so we conclude that $f$ is continuous.
Let $(x_n)_{n=1}^\infty$ be a sequence in $A$ such that $x_n \xrightarrow{n\to\infty} x \in A$. As you said, if $x \in [0,1]$ then there exists $n_0 \in \mathbb{N}$ such that $n \ge n_0 \implies x_n \in [0,1]$.
Therefore, the sequence $(x_n)_{n=n_0}^\infty$ is in $[0,1]$ and also converges to $x$. Since $\operatorname{sq}$ is continuous, we have:
$$f(x_n) = \operatorname{sq}(x_n) \xrightarrow{n\to\infty, n \ge n_0} \operatorname{sq}(x) = f(x)$$
Similarly we would conclude that $f(x_n) \xrightarrow{n\to\infty} f(x)$ if $x \in [2,3]$.