Uniform continuity on subsets of closed intervals

I've tried to find the answer to this question but haven't had any luck so far. I know that if a function is continuous over a closed interval, then it is uniformly continuous over the same interval.

So, if we know a function is uniformly continuous over $[a, b]\in \mathbb R$, can we assume that it is uniformly continuous over any subset of $[a,b]$ (in particular, $(a, b)$)? If not, why?

Thanks in advance for any help you may be able to give me.

• Of course, by definition. – Kabo Murphy May 7 '18 at 5:10
• @KaviRamaMurthy I thought so, I just needed someone to check my reasoning because I need to use it in a proof for an assignment and didn't know if it made sense. Thanks :) – Reece Jocumsen May 7 '18 at 5:11
• Careful: $[a,\infty)$ is a closed interval – zhw. May 7 '18 at 17:02
• ^ So, closed and bounded. – alwaysiamcaesar May 11 at 21:37

$f$ is uniformly continuous on $[a,b]$ if for all $\epsilon > 0$, there exist $\delta > 0$ such that whenever $|x-y| < \delta$, we have $|f(x) - f(y)| < \epsilon$.
Now can you restrict this condition to any subset of $[a,b]$?
$\forall x,y\in[a,b], |x-y|<\delta\rightarrow|f(x)-f(y)|<\epsilon$ entails that $\forall S\subseteq[a,b]$, $\forall x,y\in S$, $|x-y|<\delta\rightarrow|f(x)-f(y)|<\epsilon$.