# Continuous function and the openess of points

Suppose that I have a continuous function $f: X \rightarrow Y$ such that $f(a) = f(b)$ where $a$ and $b$ are points of $X$. Is it the case that we have that either both $a$ and $b$ are open or neither $a$ nor $b$ are open?

Thanks

-
Hopefully $a$ is a point of $X$ and $b$ is a point of $y$... – Arthur Dec 6 '12 at 15:02
@Arthur: That would make the question nonsense, so let's not hope that. – Chris Eagle Dec 6 '12 at 15:03
Sorry, I misread the question. – Arthur Dec 6 '12 at 15:04
Note that you don't say "$a$ is open", but rather "(the set) $\{a\}$ is open". – David Mitra Dec 6 '12 at 15:07

Notice that a constant function $f: X \rightarrow Y$ is continuous. And for any two points $x,y \in X$ that $f(x)=f(y)$. This hold for any topology on $X$ so we have that $\{x\}$ can be open, closed or neither and similarly for $\{y\}$ with no dependence between the two.