a) I'll show the compliment of $ A+B $, call it $ {(A+B)}^c $ is open.
Let $ r \in {(A+B)}^c $.
Then $ r \neq a+b \ \forall \ a,b \in A,B $ resp.
Let $ S=\{r-a:a \in A \ \} $
Then $ S \cap B = \O $.
Now, S is closed because if $ \{s_n\} $ is a sequence in S converging to some x then,
$ r-a_n \rightarrow x $, some $ \{a_n\}\in A $
$ \Rightarrow a_n \rightarrow r-x $
$ \Rightarrow r-x \in A $, since A is closed
$ \Rightarrow r-(r-x) \in \ S \Rightarrow x \in S. $
So S is closed.
Therefore, $ d(S,B)>0 $.
This is true since if $ d(S,B)=0 $ then, since B is compact hence bounded, there would exist some $ M>0 $ such that $ d(S\cap[-M,M],B)=0 $, but $ S\cap [-M,M] $ is compact, and disjoint compact sets have positive distance between them.
So let $ \epsilon = \frac{1}{2} d(S,B) $. Then for any $ t \in (r-\epsilon, r+ \epsilon) $ and any $ a \in A $, $ d(t-a,S)<\epsilon \Rightarrow t-a \not\in B \ \forall a \in A \Rightarrow t \in {(A+B)}^c \Rightarrow (r-\epsilon, r+ \epsilon) \subset {(A+B)}^c \Rightarrow {(A+B)}^c $ is open $ \Rightarrow A+B $ is closed.
b)
Let $ A = \cup_{n \ even,\ n>2}[n+1/n,n+1-1/n] $
$ B = \cup_{n \ odd, \ n>3}[-(n+1-1/n), -(n+1/n)] $
Then A and B are both closed since their compliments are unions of open intervals, however $ A+B $ is not closed since 0 is a limit point of $ A+B $ that is not in the set.
--Wardbc 13:05, 5 July 2008 (EDT)