Topology; Definition of the open ball and open sets confuses me I just picked up T.W Gamelin’s book on topology. I started reading and got confused when I came to the definition of an open ball on the second page. 
It says $B(x;r) =$ All $y$ in the set $X$ such that $d(x,y)$ is less than $r$. All is clear so far.
But then he goes on to saying that the union of all $B(x;r)$ for $r>0$ is equal to the whole set of $X$ itself. I can buy this as the definition of the ball is “all $y$ that lies in $X$”, but to me this seems to contradict the definition of an open set. 
If I pick a set in $\Bbb R^2$ that contains its boundary, pick an $x$ that lies on the boundary. Then there exists a $B(x;r)$ even for the $x$’s on the boundary (it’s just that the ‘ball doesn’t have the shape of a ball?). 
And then according to the definition a closed set is open?
Do you understand my problem? I would be grateful if someone could help me sort this out...
Kind regards,
 A: As an example, consider the closed unit disk $D = \{(x,y) \in \mathbb{R}^2: x^2 + y^2 \le 1\}$. This is a closed set when considered as a subset of $\mathbb{R}^2$, in its usual Euclidean metric. And it's not open there, as shown by points like $(1,0)$: every open ball around $(1,0)$ with radius $r$ contains a point $(1 + \frac{r}{2},0) \notin D$, so there is no open ball of $\mathbb{R}^2$ around $(1,0)$ that sits inside $D$
But when we consider $D$ as a metric space $(X,d)$ in its own right, using the same metric formula $d((x,y), (u,v)) = \sqrt{(x-u)^2 + (y-v)^2}$, then by definition the open ball in that metric is a subset of $D$ and so we get a part of the open ball that sits inside $D$, as the points outside are not in the space we are considering. And then $D$ is indeed open in $D$ (but not in $\mathbb{R}^2$!). Closed and open are relative notions with respect to the space we are considering, not absolute ones.
A: Of course, there exists a ball around every point in the whole space $X$.
But a particular subset $U$ of the whole space $X$ is an open set if for each point $x\in U$ there is a ball with the property that the entire ball itself, not just the point $x$, lies in $U$.
Intuitively, it means that if you are in $U$, the there is a little region around you that is also in $U$; open sets don't contain their "edges". They are "fat" in the vicinity of each of their points.
A: A topology on a set $X$ is what you know : a subset $\mathcal{T}$ of the set of subsets of $X$ that is stable by unions and finite intersections. Now you can define a so called basis $\mathcal{B}$ of $\mathcal{T}$ as a subset of $\mathcal{T}$ such that for each $U\in\mathcal{T}$ and each $x\in U$ there is a $B\in \mathcal{B}$ such that $x\in B\subseteq U$.
This is equivalent (exercise !) to say that each $U$ of $\mathcal{T}$ is union of elements of $\mathcal{B}$, hence the name "basis" of the topology. A basis is useful as it allows to express a lot of properties with only sets from $\mathcal{B}$ instead of using sets of $\mathcal{T}$.
Typically the usual topology on $\mathbf{R}$ has as basis the set of all open balls. And then, to check that an $f : \mathbf{R}\rightarrow \mathbf{R}$ is continuous, you can only check that for each $x\in \mathbf{R}$ there's an open ball $B'$ around $f(x)$ there is an open ball $B$ around $x$ such that $f(B)\subseteq B'$, instead of checking that for any neighborhood $V$ of $f(x)$ there is an neighborhood $U$ of $x$ such that $f(U)\subseteq V$.
