According to Heine's Theorem, "If a function is continuous on a closed and bounded interval, then the function is uniformly continuous on that interval."
I understand why Heine says "closed" but I don't understand why he says "bounded."
Can't I just say "If a function is continuous on a closed interval, then the function is uniformly continuous on that interval." ? Can somebody give me a counter example for this?
The function $f:\mathbb{R} \longrightarrow \mathbb{R}$ you mentioned does not violates the statement.
For an example function $f:D \longrightarrow \mathbb{R}$ violates the statement, (which is actually impossible) the following two condition should be satisfied; i. $D$ is closed and bounded interval and $f$ is continuous on $D$ ii. $f$ is not uniformly continuous on the interval.
Since your function $f$ does not satisfies 'i', it is not a counterexample of the statement.