For x<3 f(x)=3-x and for x>3 f(x)=x-3, for x=3, f(x)=1 is discontinuous.
For x<3 f(x)=3-x and for x>3 f(x)=x-3, for x=3, f(x)=0 is continuous. The left and right limits as x→3 are both zero.
f(x)=|x-3| is continuous and fulfils the above conditions, i.e., f(3)=0, which is the limit as x→3.