The function is defined at all points of the real line.
Case:1
Checking continuity at x=1
f is continuous at x=1
if L.H.L=R.H.L=f(1)
limx→1−f(x)=limx→1+f(x)=f(1)
L.H.L=limx→1−f(x)=limx→1−(x+2)
=1+2=3
R.H.L=limx→1+f(x)=limx→1+(x−2)
=1−2=−1
Since L.H.L≠ R.H.L
⇒f is not continuous at x=1
Case2:
Let c be a real number greater than 1
So, x=c where c>1
∴f(x)=x−2
f is continuous at x=c if limx→cf(x)=f(c)
L.H.L=limx→cf(x)=limx→c(x−2)=c=2
f(x)=x−2⇒f(c)=c−2
∴limx→cf(x)=f(c)
Hence f is continuous at x=c
⇒f is continuous at all points x>1
Case3:
Let c be any real number less than 1
So, x=c where c<1
f(x)=x+2 as x=c,c<1
f is continuous at x=c if limx→cf(x)=f(c)
limx→cf(x)=limx→c(x+2)=c+2
f(x)=x+2⇒f(c)=c+2
Hence limx→cf(x)=f(c)
∴f is continuous for all real number less than 1
Hence only x=1 is point of discontinuity.
⇒f is continuous at all real point except 1
Thus, f is continuous for x∈R−{1}