Let $A = (0,1] \cup \{2\}$, considered as a subset of $\mathbb{R}$. Show that every function $f: A \rightarrow \mathbb{R}$ is continuous relative to A at 2.
My attempt:
For $f$ to be continuous at 2. $\forall$ $\epsilon > 0$ , $\exists \delta > 0$ such that:
$f(B_{\delta}(2)) \subset B_{\epsilon}(f(2))$. Now, $B_{\delta}(2))$ is an open set in A and hence we can claim that $f$ is continuous at 2 relative to $A$.
You're given $\varepsilon>0$. You take $\delta=1$, whatever $\varepsilon$ is.
Then for this $\delta$: $$B_\delta(2)=\{x \in A: d(x,2) < 1 \} = \{2\}$$
and certainly it is the case that $f[B_\delta(2)] =\{f(2)\} \subseteq B_\varepsilon(f(2))$, as $f(2) \in B_\varepsilon(f(2))$.
The point is that you have to take the structure of $A$ into account and pick a specific $\delta$ for the situation. You cannot just claim that "the ball is open and so is its image" for any $f$ you don't know anything about; it's bound to be false in general.. You have to apply the definition: give a concrete $\delta$ for any $\varepsilon >0$ and then give a valid reasoning. See above.