Fix a point a in a metric space (M,d), and define f:M->R by f(x)=d(x,a). Show f is continuous on M.

I took a sequence Xn->x in (M,d)

So f(Xn)=d(Xn,a)

taking the limit, f(Xn)->d(x,a)=f(x)

Since we have Xn->x => f(Xn)->f(x), f is continuous on M.

But I feel like that's wrong, because how do we know f(x) is in R?

I need to show if Xn->x in (M,d), then f(Xn)->f(x) in R.....but I don't know whether or not f(x) is in R do I? Am i missing something obvious?

Thanks guys.