If $(X,d)$ topological space and $f,g:X\to \Bbb{R}$ are continuous, then so is $f+g$ Let $(X,d)$ be topological space and let $C(X)$ denote the set of continuous functions  $f:X\to \Bbb{R}$. Show that if $f,g\in C(X)$ then $f+g\in C(X)$. I've seen online references of the continuity of addition topology or something around that, but my notes don't seem to really refer those topology (only the product topology is mentioned and nothing was said about it being continuous). The definition I am equipped with is: 
$f:X\to Y$ where $(X,\tau_X),(Y,\tau_Y)$ are topological spaces is called "continuous" if $\forall U\in \tau_Y, f^{-1}(U)\in \tau_X$. 
$\tau \subset P(X)$ is defined to be the topology of $X$ if $$\emptyset,X\in \tau $$ 
$$\forall B\subset \tau, \cup_{U\in B}U\in \tau $$ 
$$\forall B\subset \tau, |B|\in \Bbb{N}, \cap_{U\in B}U\in \tau $$.
This is pretty much what I am equipped with, apart from an equivalences statement relying on that definition. I really can't tell how the proof can be done that way. What should I be looking at? 
 A: It suffices* to prove that the pre-images of intervals $ (-\infty, A)$ are open in $X$.
$$ (f+g)^{-1}(-\infty, A)=\{x \in X \ | f(x)+g(x) < A \} = \cup_{B \in \mathbb{R}} (\{x| g(x) < B \} \cap  \{x | f(x) < A-B \})$$
$\{x| g(x) < B \}$ and  $\{x | f(x) < A-B \}$ are open for any numbers A and B, because $f$ and $g$ are continuous.
So, the set above, as the union of open sets is open. Thus, $f+g$ is continuous.


*

*Because these sets form a basis for the topology of real line. 

A: Let $(x,y) \in X^2$ and $V$ be a neighborhood of $(f(x), g(y))$. Then, there  are open neighborhoods $V_1$ of $f(x)$ and $V_2$ of $g(y)$ such that $V_1 \times V_2 \subseteq V$. Now, 
$$ (f,g)^{-1}(V_1 \times V_2) = f^{-1}(V_1) \times g^{-1}(V_2) $$
is a neighborhood of $(x,y)$. That is, $(x,y)\mapsto (f(x),g(y))$ is a continuous mapping from $X^2$ into $\mathbb R^2$.
Now, composition of continuous functions is continuous again. 
A: Let $h = f+g$, which is to say $h(x) = f(x) + g(x)$. It suffices to show that for any $U = (a,b)$, $h^{-1}(U)$ is open.
Note that
$$
h^{-1}(U) = \{x \in X : h(x) \in U\} = 
\{x \in X : a < f(x) + g(x) < b\}
$$
Now, fix an $x \in h^{-1}(U)$.  To show that $h^{-1}(U)$ is open, it suffices to find any open $V \subset h^{-1}(U)$ such that $x \in V$.  We know that $h(x) = f(x) + g(x) \in (a,b)$, so let $\epsilon = \min\{h(x) - a, b - h(x)\}$.  Because $f$ is continuous, $V_1 = f^{-1}(f(x) - \epsilon/2,f(x) + \epsilon/2)$ is open and contains $x$.  Similarly, $V_2 = g^{-1}(g(x) - \epsilon/2,g(x) + \epsilon/2)$ is open and contains $x$.  Thus, $V = V_1 \cap V_2$ is open and contains $x$.  Moreover, for any $y \in V$, we have
$$
a \leq f(x) - \epsilon/2 + g(x) - \epsilon/2 < \\
f(y) + g(y) <\\
f(x) + \epsilon/2 + g(x) + \epsilon/2 \leq b
$$
which is to say that $h(y) \in (a,b)$.  Thus, we have $x \in V \subset h^{-1}(U)$, as was desired.

The procedure behind this proof is a generalization has a lot in common with the idea of an "$\epsilon$-$\delta$ proof".  It is a exercise for you to consider how you would go about proving the statement if $X$ were a metric space; I think you'll find that the structure ends up being fairly similar. In particular, I claim the following:

The following are equivalent: 
  
  
*
  
*$h:X \to Y$ is continuous 
  
*For every open $U \subset Y$ and every $x \in h^{-1}(U)$, there is an open set $V$ containing $x$ such that $V \subset h^{-1}(U)$ 
  
*For every $x \in X$ and every open $U \subset Y$ that contains $f(x)$, there is an open set $V$ containing $x$ such that $h(V) \subset U$
  
*Let $\mathcal A$ and $\mathcal B$ be topological bases for $X$ and $Y$ respectively.  For every $x \in X$ and every $U \in \mathcal B$ containing $f(x)$, there is a $V \in \mathcal A$ containing $x$ such that $f(V) \subset U$. 
  

2 is the definition that I use in my proof.  4 is the direct topological analogue to the $\epsilon$-$\delta$ definition.  The thing we should consider, then, is why does 2 imply 1 in the above list?
Suppose that $h^{-1}(U)$ is such that for every $x \in h^{-1}(U)$, there is an open $V_x \subset h^{-1}(U)$ containing $x$.  Consider the union of all such sets.  That is, define
$$
V' = \bigcup_{x \in h^{-1}(U)}V_x
$$
Since each $V_x$ is a subset of $h^{-1}(U)$, $V' \subset h^{-1}(U)$.  Conversely, for each $x \in h^{-1}(U)$, $x \in V_x \subset V'$, which means that $h^{-1}(U) \subset V'$.  So, $V' = h^{-1}(U)$.  Moreover, $V'$ is a union of open sets, and any union of open sets is necessarily open.  So, $h^{-1}(U)$ is open.
Thus, if $h$ satisfies the conditions for 2, then $h^{-1}(U)$ is open for every open $U \subset Y$.  That is, $h$ is continuous.
So, why do we care about $V_1$ and $V_2$ in the proof?  Each is an open set containing $x$, and their intersection $V = V_1 \cap V_2$ is an open subset of $h^{-1}(U)$ containing $x$.
