# Topology question - need help

1. Jun 26, 2011

### mbarby

hi all,
i am studying from croom's introduction to topology book. i came across such a question. and i dont have a clue as to how to start .
Let X be a metric space with metric d and A a non-empty subset of X. define f:X->IR by :

f(x): d(x,A), x E X (x is an element of X)
show that f is continuous.

also if you can point out a solution book for this book that would be rather nice, considering i am computer scientist studying the topic at home..
thx.

2. Jun 26, 2011

### micromass

Hi mbarby!

You'll need to prove that

$$d(x,y)<\delta~\Rightarrow~|d(x,A)-d(y,A)|<\varepsilon$$

Can you first prove that

$$-d(x,y)<d(x,A)-d(y,A)<d(x,y)$$

3. Jun 27, 2011

### mbarby

to prove that i use the triangular inequality
d(x,A) <= d(x,y)+d(y,A)
d(x,A) - d(y,A) <= d(x,y)

--->
-d(x,y) <= d(x,A) - d(y,A) <= d(x,y)

but honestly i couldnt connect it to any kind of a proof :/ ...

Last edited: Jun 27, 2011
4. Jun 27, 2011

### micromass

Doesnt that immediately imply

$$|d(x,A)-d(y,A)|\leq d(x,y)$$

and this would imply continuity...