There is no need to use contradiction for Part (1). It’s totally straightforward.

Let . You want to show that f is continuous atx. Given , simply set and you have that , .

Part (2):

f is a function fromMontoN; in other words, it is surjective.

Let . Then

So f is injective as well. Hence it is a homeomorphism.