Sequence of functions, uniform convergence

1. The problem statement, all variables and given/known data
{f_n} is a sequence of continuous functions on E=[a,b] that converges uniformly on E. for each x in E, set g(x)=sup{f_n(x)}. Prove that g is continuous on E

2. Relevant equations

3. The attempt at a solution
I've got an idea to prove it:
Let e>0 be given, there is a N such that
|f_n(x)-f(x)|<e
for all n>N and all x in E.
Let K_n={x|f_n(x)>=e+f(x)}, n=1,2,3....,N.
each K_n is closed since f_n is continuous.
Let [tex]A=\cup^{N}_{1} K_{i}[/tex] then A is closed.
g(x) is continuous on A (since there are only N functions to deal with. And I find it tedious to prove?)
Let B=E-A.
Then f(x)<=g(x)<f(x)+e, for any x in B.
let p be an interior point in B.
if g(p)=f_k(p), for some k>N.
since f_k(p) is continuous, there is a neighborhood of p such that if q is in it and also in B.
|f_k(p)-f_k(q)|<e
then,
|g(p)-g(q)|<=|f_k(p)-f_k(q)|+|f_k(q)-g(q)|<=e+|f_k(q)-f(q)|+|f(q)-g(q)|<=e+e+e=3e.
hence g(x) is continuous at p.
if g(p)=f(p).
|g(p)-g(q)|<=|f(p)-f(q)|+|f(q)-g(q)|=2e, which implies
g(x) is continuous at p.
It is analogous to say that g(x) is continuous if p is the boundary point of B.

It seems okay. But I'm not satisfied with it, it looks so lenthy and not well organized and I believe there is some other proof much better than this one. Any hint?

Imagine if your functions were just fk(x) = 1-1/k on the whole interval. Then fk converges to 1 uniformly, and clearly A is empty as fn < f everywhere for all n. Then B is the whole interval, yet g(x) =/= fk(x) for any x,k combination. I think this is fixed by a better definition of Kn (probably what you wrote isn't what you really intended)