need to prove that set of points of continuities of $f$ is dense in $X$ $(X,d)$ be a complete metric space,$f:X\to\mathbb{R}$ be such that $\forall\alpha\in\mathbb{R},\{x:f(x)<\alpha\}$ is an open set in $X$. I need to prove that set of points of continuities of $f$ is dense in $X$
I know these stuffs which I intuitively think I need to apply to solve the problem but not able to bring out any fruitful complete logic.


*

*Set of points of continuity of a function can be written as countable intersection of open sets. ($G_{\delta}$ set)

*A complete metric space can not be written as a countable union of nowhere dense sets or if $A_n,n\in\mathbb{N}$ be open dense set such that $\cap A_n\ne \emptyset$ then $\cap A_n$ is dense.

*In a complete metric space every cauchy sequence has its limits in it.
Could anyone help me to start solving the problem ?
 A: This can be done in 2 steps :


*

*For $a < b$ in $\mathbb{R}$ define
$$
A_{[a,b]} = \{x \in X : f(x) \geq b, \text{ and } \exists (x_j), x_j\to x, \text{ such that } \lim_j f(x_j) \leq a\}
$$
Show that $A_{[a,b]}$ is closed and has empty interior.

*For each $k\in \mathbb{Z}, m\in \mathbb{N}$, define
$$
B_{k,m} = A_{\left[ \frac{k-1}{m}, \frac{k}{m} \right]}^c
$$
Show that, if
$$
x \in \bigcap_{k,m} B_{k,m}
$$
then $f$ is continuous at $x$.


Now you can apply Baire category.
A: It seems the following. 
Assume the converse. Let $U\subset X$ be a non-empty open set without continuity points of the map $f$ in it. Then for each point $x\in U$ there exist a number $n(x)$ and a sequence $\{x_i\}$ of points of $X$ converging to the point $x$ such that $$|f(x_i)-f(x)|\ge 1/n(x)$$ for each index $i$.
Since a set $$\{y\in X : f(y)<f(x)+1/(2n(x))\}$$ is open, refining the sequence $\{x_i\}$ to a subsequence, if necessarily, we may assume that  $$f(x_i)-f(x)\ge 1/n(x)$$ for each index $i$. 
For each natural $n$ put $$U_n=\{x\in u:n(x)=n\}.$$ Since the set $U$ is a non-empty open subset of a complete metric space, it is Baire, so there exist a non-empty open subset $V$ of the set $U$ and a number $n$ such that $U_n$ is dense in $V$. Let $x\in V\cap U_n$ be an arbitrary point. There exists a sequence $\{x_i\}$ of points of $X$ converging to the point $x$ such that $$f(x_i)-f(x)\ge 1/n(x)$$  for each index $i$. 
Since a set $$W=\{y\in X: f(y)<f(x)+1/(2n)\}$$ is open, there exists a point $x_i\in W$, a contradiction.
