I thought it was closed, under the usual topology $\mathbb{R}$, since its compliment $(-\infty, 0) \cup (1,\infty)$ is open.
However, then then intersection number would not agree mod 2, since it can arbitrarily intersect a compact manifold even or odd times.
P.S. The corollary.
$X$ and $Z$ are closed submanifolds inside $Y$ with complementary dimension, and at least one of them is compact. If $g_0, g_1: X \to Y$ are arbitrary homotopic maps, then we have $I_2(g_0, Z) = I_2(g_1, Z).$
The contradiction (my question):
Let [0,1] be the closed manifold $Z$, and then it can intersect an arbitrary compact manifold any times, contradicting with the corollary.
Aneesh Karthik C's comment answered my question, so just to clarify:
I was thinking $g_0$ is one wiggle of [0,1] such that it intersects a compact manifold once, and $g_1$ is some other sort that [0,1] intersect twice. Then it contradicts with the corollary. But apparently it doesn't, because [0,1] does not satisfy the corollary as a closed manifold. By definition, a closed manifold is a type of topological space, namely a compact manifold without boundary.
Since [0,1] is not a closed manifold, it can intersect a compact manifold as much as it want, without contradicting with the theorem.
I didn't realize that [0,1] is not a closed manifold. So I thought it contradicts and that's why I ask the question.
A closed manifold is a compact boundaryless manifold. So the last line "Let [0,1] be the closed manifold Z" is wrong, for $\partial[0,1]\ne\phi$.