Though the already offered answers are correct, I'd like to try to give a view of why topologies are defined this way.
The idea of an open set is that for each point in the set, the set should also contain all other points that are sufficiently close to it. Or stated in another way, you should not be able to approach a point within an open set without entering the set. So openness is an expression of what it means to be close. In a metric space, we can define closeness by means of distance. But in a more general setting, this is not possible. So instead we define closeness by simply listing what sets we want to be open. This "list" is just a set containing all the open sets in the space, called the topology.
The topology has to capture the basic properties of what closeness ought to be. It turns out that there are two properties that incapsulate the idea (I can expand on why "closeness" should satisfy these, but in the interest of brevity will not). These are that the union of any collection of open sets ought to be open, and that the intersection of any two open sets should also be open. For technical reasons, the entire space and empty set (both of which obviously must contain every point sufficiently close to any point inside them) are also considered open. So these four conditions are what is required to be a topology.
As an example of a useful non-metric topology, consider limits from above. For example:
$$\lim_{x \to 0+} f(x)$$
The idea of a limit expresses an idea of what is close. So these limits should be expressible topologically. The limit says that how $f$ behaves above $0$ is important, but how $f$ behaves below $0$ is not. As far as the limit is concerned, what is below $0$ is not close. Only what is above. That is, the intervals $[0, \epsilon)$ define what is close to $0$.
So define $\mathscr T_1 = \{[a,b)\mid a < b \le \infty\} \cup \{\emptyset\}$. If $[a,b), [c, d) \in \scr T_1$, and WLOG, $a \le c \le d$, then $$[a,b)\cap[c,d) = \begin{cases} \emptyset & b\le c\\
[c, b) & b\le d\\
[c, d) & d < b\end{cases}$$
Hence the intersection of any two sets in $\scr T_1$ is also in $\scr T_1$. But unions are not. So we define $${\scr T} = \left\{\bigcup_{B \in \scr{A}} B \mid \scr{A} \subseteq \scr{T}_1\right\}$$
$\scr T$ is then a topology. Denote the standard topology on $\Bbb R$ by $\scr S$. Then for a function $f: \Bbb R \to \Bbb R$, the limit from above at a point $a$ is the limit at $a$ when the topology on the domain of $f$ is taken to be $\scr T$, but on the codomain the topology is still $\scr S$. This general topological definition of limit is:
- $\lim_\limits{x \to a+} f(x) = L$ if for every $S \in \scr S$ with $L \in S$, there is an $A \in\scr T$ with $a \in A$ and $f(A \setminus \{a\}) \subseteq S$.