TITLE: A trivial question about continuity
QUESTION [6 upvotes]: $f:\mathbb{R}\longrightarrow\mathbb{R}:x\mapsto x^2$
This function is continuous as we all know.
Since for every point in the domain, we will always be able to draw a $\delta\epsilon-$rectangle,
for every $\epsilon$ which captures every point of $f(x)$ if it captures $x$.
As i first started looking on continuouity I thought it exists to help clearify weither a curve has "holes". Or points where the curve diverges.
It made sense to me, but then I thought what does it mean to be pointwise continuous?
$h:\lbrace 1,2,3 \rbrace\longrightarrow\mathbb{R}:x\mapsto x^2$ is this function also continuous? Why shouldnt it be? 
I mean if i can pointwise look at a curve and take all the points out of the domain where it is uncontinuous, the curve will be continuous. But I could also take alot of points where the function is continuous out of the domain and it should stay continuous. Even if I leave the function only with a set of ,for example, 3 elements in the domain.
Is this correct?
And if yes, what is the advantage of stating a function like $h$ is still continuous, if it has nothing left to do with curves.
So why do we need this property? Shouldnt it also has some value for $h$ to be continuous?
I know this question is really basic, and stupid, but it really interests me to understand what "pointwise-continuity really means for a function. Thank you

REPLY [2 votes]: So, we need to be careful. Continuity is first and foremost a topological term. In the category of topological spaces, continuous maps are the morphisms and topological spaces the corresponding objects.
That means, in order to be able to talk about continuity, we need to make sure the spaces we are talking about are in fact topological spaces. 
The definition of continuity in the language of topological spaces is the following:

Let $X,Y$ be topological spaces with topologies $\mathcal{T}_X$ and
  $\mathcal{T}_Y$ respectively. A map $f:X\to Y$ is continuous,
  if for every open set $V\subset Y$ in $\mathcal{T}_Y$, the set
  $f^{-1}(V) \subset X$ is open in $\mathcal{T}_X$.

So you notice, continuity does not "come out of thin air", but is dependend on the given topological structure the corresponding sets admit.
Given your example of $\{1,2,3\}$ we can actually define a topology $\mathcal{T}$ on it by declaring its open sets to be  $\{1,2,3\}, \varnothing, \{1\}, \{2\},\{3\}$. and any union of these elements. To sum it up we get
$$\mathcal{T} = \{\{1,2,3\}, \varnothing, \{1\}, \{2\},\{3\},\{1,2\},\{1,3\},\{2,3\}\}$$
Now we can actually use this topology $\mathcal{T}$  on $\{1,2,3\}$ together with your map $f:\{1,2,3\}\to \mathbb{R}$ to induce a topology on $\mathbb{R}$ (called the final topology) via 
$$\mathcal{T}_\mathbb{R} = \{ U \subset \mathbb{R} \mid f^{-1}(U) \in \mathcal{T}\}$$
What we are doing here is, we define the open subsets of $\mathbb{R}$ exactly to be those subsets, for which $f^{-1}(U)$ is an element of $\mathcal{T}$, i.e. of the given topology on $\{1,2,3\}$.
Now how do the open sets of $\mathbb{R}$ with respect to $\mathcal{T}_\mathbb{R}$ look like?
Considering that we have $$f\colon \{1,2,3\} \mapsto \mathbb{R},\ x \mapsto x^2$$ 
we get $$\mathcal{T}_\mathbb{R} =\{ \mathbb{R}, \varnothing,\{1\},\{4\},\{9\},\{1,4\},\{1,9\},\{4,9\},\{1,4,9\} \}$$ 
Now by construction, your map $f$ is actually continuous on $\{1,2,3\}$! That's simply because we build the topology on $\mathbb{R}$ in exactly the way that the preimage of $f$ for every declared open subset of $\mathbb{R}$ is an open subset of $\{1,2,3\}$.
Now you can't possibly draw your function $f$ in the same way you would expect it to look like as if we had a function $f:\mathbb{R} \to \mathbb{R}$.
But any visualization is fine, as long as it reflects what's actually happening, namely the preimage of every open subset in $\mathcal{T_\mathbb{R}}$ is an element of $\mathcal{T}$.
Do not hesitate to ask questions, if you have any.