It's the idea indeed. A point on which the limit is infinite can only be a or b.

Assume that f is not bounded. We can find a sequence such that .

You can extract from a Cauchy subsequence since it's a bounded one. is also uniformly continuous hence is also a Cauchy sequence. We get a contradiction.