Continuous function that is uniformly continuous on a dense subset
The statement, and your proof of it, are correct.
There is also a stronger form of this fact: if a function is uniformly continuous on a dense set, then it has a (unique) continuous extension to the entire space, which is also uniformly continuous.