Q:

Is real line a closed or open interval?

Is real line an open or closed interval $(-\infty,+\infty)$?
I found this written in my lecture slide.

"The entire real line is infinite interval that is both open and
  closed."

Can anyone explain what does that mean?

A:

First of all, note that closed set and closed interval are different things! Similarly open set and open intervals are different things. 
For example: $\mathbb{N}$ is closed set but not a closed interval. 
$(1,2) ∪ (3, 4)$ is open set  in $\mathbb{R}$ but not an open interval.
Real line or set of real numbers $\mathbb{R}$ is both "open as well closed set". Note $\mathbb{R}$ not a closed interval,  that is $\mathbb{R} ≠ [-∞, ∞]$.
For definition of open and closed sets, See here
https://en.m.wikipedia.org/wiki/Open_set
https://en.m.wikipedia.org/wiki/Closed_set

