I'm having troubles solving the following exercise, proposed in Kosniowski's "A first course in Algebraic Topology", and any help would be appreciated!
Consider the topological space $X:=(\mathbb{R}, \mathcal{T})$, where $\mathcal{T}=\{\emptyset\}\cup \{\mathbb{R}\} \cup \{(-\infty, t):t \in \mathbb{R}\}$. Prove that a function $f: X \to X$ is continuous if and only if it is non-decreasing (that is, if $x > x'$, then $f(x)\ge f(x')$) and continuous on the right (that is, $\forall x \in \mathbb{R}$ and all $\epsilon > 0$ there exists $\delta > 0$ such that if $x' \in [x, x + \delta)$, then $|f(x) - f(x')| < \epsilon$).