Suppose $X$ is a topological space and both $f,g$ are continuous functions from $X$ to $R$, Show that $(f+g)(x)$ is continuous Problem: Suppose $X$ is a topological space and both $f, g$ are continuous functions from $X$ to $\Bbb R$, I wish to show that $(f+g)(x)$ with the same domain and range is continuous. 
My attempt: 
First of all it's worth noting that my definition of a map being continuous
is that the inverse image of an open set in the co-domain is open in the domain. So take an open subset $U$ of $\Bbb R$, with the set of all bounded open intervals as the basis of the topology $\Bbb R$, then it suffices to consider the inverse image of a basis element of $\Bbb R$, say B centered at $r \in \Bbb R$ with radius $\epsilon>0$,
Then by the continuity of $f,g$ there exist neighbourhooods (pre-images) $N,M$ of $X$ such that $f(x) \in B_{\epsilon/2}(r)$ when $x \in N$,  $g(x) \in B_{\epsilon/2}(r)$ when $x \in M$ , and so by taking $x \in N \cap M$ (an open set), we have
$|f(x)+g(x)-r| \leq |f(x)|+|g(x)-r|< r+ \epsilon/2 + \epsilon/2 ,$ and so $f(x)+g(x) \in B_{\epsilon}(r)$
It's worth noting that this problem has been asked several times on Math SE, but I believe my particular approach is somewhat unique, and I want to know if I am on the right track. Is the set $N \cap M = (f+g)^{-1} (U)$ (pre-image)?
 A: f:X -> X×X, x -> (x,x)
g:X×X -> R×R, (x,y) -> (f(x), g(x))
h:R×R -> R, (x,y) -> x + y  
are continuous functions.  Thus the composition
h o g o f:R -> R, x -> f(x) + g(x) is continuous.
A: The map $f \nabla g: X \to \mathbb{R} \times \mathbb{R}$ given by $(f \nabla g)(x) = (f(x), g(x))$ is continuous as the composition with both projections are continuous (universal property of products): $\pi_1 \circ (f \nabla g) = f$ and $\pi_2 \circ (f \nabla g) = g$. You only need to show that $p: \mathbb{R} \times \mathbb{R} \to \mathbb{R}$ given by $p(x,y) = x+y$ is continuous, to conclude that $$f+g = p \circ (f \nabla g) $$ is continuous.
And that $p$ is continuous is quite easy to see, using some inequalities involving metrics on $\mathbb{R}^2$.
A: Firstly, you're approach doesn't quite cut it.  You show that $N\cap M\subset(f+g)^{-1}(B_{r+\varepsilon}(r))$, which isn't what you wanted to show for two reasons:  you want to show that $(f+g)^{-1}(B_{\varepsilon}(r))$ is open (not $(f+g)^{-1}(B_{r+\varepsilon}(r))$), and you want to show that the whole pre-image is open, not just that it contains an open set.
I'll admit that your approach could work, but it's not the easiest to work with.  One thing that could go wrong is that if $f$ and $g$ are bounded, then $f+g$ is bounded, so there will be plenty of $r$ and $\varepsilon$ such that $(f+g)^{-1}(B_\varepsilon(r))$ is empty.  So you have to take this into account.  And there are a plethora of other things that make this difficult, which basically boils down to the fact that the pre-image of a set under the sum is not a nice looking set (i.e., if $A\subset\mathbb R$, then $+^{-1}(A)=\{(x,y)\in \mathbb R^2: x+y\in A\}$ isn't the easiest set to work with).
That's why, as you've mentioned, most methods you'll see on this site try to show continuity locally.  That is, to show that $f+g$ is continuous, most prefer to show that $f+g$ is continuous at each $x\in X$.
