In this section, we will review more general topology.
First, we take real functions $f:\mathbb{R}\supset D\rightarrow\mathbb{R}$ as an example to motivate the definition of continuous functions between topological spaces.
Definition. We say that $f$ is continuous at a point $x_{0}\in D$ if for every $\varepsilon>0$, there exists $\delta>0$ such that for all $x\in D$, $\left|x-x_{0}\right|<\delta$ implies $\left|f(x)-f(x_{0})\right|<\varepsilon$.
Lemma. Let $x\in D$. Then $f$ is continuous at $x$ if and only if for every neighborhood $V\ni f(x)$ there exists a neighborhood $U\ni x$ such that $f(U)\subset V$.
Proof. Assume that $f$ is continuous at $x$. By definition, for every neighborhood $\mathbb{B}(f(x),\varepsilon)$ there exists a neighborhood $\mathbb{B}(x,\delta)$ such that $f(\mathbb{B}(x,\delta))\subset\mathbb{B}(f(x),\varepsilon)$.
Conversely, for every $\left|f(x)-f(x_{0})\right|<\varepsilon$, where $f(x)\in V$ and $\varepsilon>0$, there exists $\delta>0$ with $\left|x-x_{0}\right|<\delta,x\in U$.
$\Box$
So we can make use of neighborhoods to define continuity of a real function. We generalize this to topological spaces. Let $X,Y$ be two topological spaces.
Definition 3.1. We say that $f:X\rightarrow Y$ is continuous at $x\in X$ if for every open set $V\subset Y$ containing $f(x)$, there exists an open set $U\subset X$ containing $x$ such that $f(U)\subset V$. And we say that $f$ is continuous on $X$ or simply continuous if it is continuous at every point in $X$.
Proposition 3.2. A function $f:X\rightarrow Y$ is continuous if and only if for every open set $V\subset Y$, $f^{-1}(V)$ is open in $X$.
Proof. Assume that $f$ is continuous. Then for every neighborhood $V\subset Y$ of some point $y\in Y$, there exists a neighborhood $U\subset X$ of $x$ such that $f(x)=y,f(U)\subset V$. Then we have $x\in U\subset f^{-1}(f(U))\subset f^{-1}(V)$, which implies that $f^{-1}(V)$ is open in $X$.
Conversely, assume that for every open set $V\subset Y$, $f^{-1}(V)$ is open in $X$. Let $x\in f^{-1}(V)$ be some point, then $f(x)\in V$. So we have $f(f^{-1}(V))=V\subset V$, which shows that $f$ is continuous.
$\Box$
Definition 3.3. By Proposition 3.2, we can equivalently define continuous functions in terms of open sets: We say that a function $f:X\rightarrow Y$ is continuous if for every open set $V\subset Y$, $f^{-1}(V)$ is open in $X$.
Next, we introduce a map that preserves topological property.
Definition 3.4. A function $f:X\rightarrow Y$ is called a homeomorphism if $f$ is bijective and $f,f^{-1}$ are both continuous. We say that $X$ is homeomorphic to $Y$, which is denoted by $X\cong Y$, if there exists a homeomorphism $f:X\xrightarrow{\sim}Y$.
Remark 3.5. Abstractly, two homeomorphic topological spaces have no difference.
Proposition 3.6. Every compact subset of a Hausdorff space $X$ is closed.
Proposition 3.7. Every singleton of a point in a Hausdorff space $X$ is closed.
Definition 3.8. Let $X$ be a topological space. A subset $U\subset X$ is dense in $X$ if $\overline{U}=X$.