x_left <- seq(-2,0,by=0.01)
x_right <- seq(0,2,by=0.01)
y_left <- rep(1,length(x_left))
y_right <- rep(2,length(x_right))
plot(x_left,y_left,type="l",col="blue",lwd=2,
     xlim=c(-2,2),ylim=c(0,3),
     xlab="x",ylab="f(x)",main="Gioi han ben trai va ben phai tai x=0")
lines(x_right,y_right,col="red",lwd=2)
points(0,1,col="blue",pch=1,cex=1.5)
points(0,2,col="red",pch=1,cex=1.5)
legend("topleft",legend=c("x -> 0- (ben trai)","x -> 0+ (ben phai)"),
       col=c("blue","red"),lwd=2,bty="n")