Let C0 be the set of continuous functions from [a,b] to R

Let Gm = { f C0 : f is not monotone on any interval of length 1/m}

-->I need to show Gm is open for all m = 1,2,3....

Here's what I have so far:

Suppose Gm is not open. Then there is a g Gm such that:

for all n=1,2,3,4... there is a function fn C0 such that fn is in the open ball of radius 1/n around g, but fn is not in Gm.

Clearly, (fn) converges uniformly to g.

Since fk is not in Gm, then there exists an interval of length 1/m, call it, call it [ak, bk] where fk is not monotone.

Now, what I want to say is that since both (ak) and (bk) have convergent subsequences, say that converge to a and b respectively, then we have g is not monotone on [a,b], which has length 1/m, so we have a contradicition. But, I'm not sure if I can do this nor how I would do it.