a contradiction in my proof to show that T must be the discrete topology if $f:(X,T)\rightarrow (\Bbb R,T_{st})$, I dont understand . I want to prove that T is the discrete topology on X if and only if every function $f:(X,T)\rightarrow (\Bbb R, T_{st})$ is continuous.
Here's my attempt:
$(\Rightarrow)$Assume That T is the discrete topology
using the theorem that a map is continuous if and only if the inverse of the function is open in the domain for every open set it maps in the codomain , I said that as all sets are open the discrete topology that obviously $f^{-1}(\Bbb R)$ is open for all open sets in $(\Bbb R, T_{st})$ 
$(\Leftarrow)$Now suppose f is continuous $\Rightarrow$ for all $U\subset \Bbb R$ the preimage $f^{-1}(U)$ is open in (X,T)
So we know that at least for open sets we'll map to open sets, we want to show that the same is true for closed sets too though 
But heres where I get stuck, we assumed that f is continuous  which means that $f^{-1}(\Bbb R)$ is closed for every closed set in $(\Bbb R, T_{st})$ , but closed sets exist in $(\Bbb R, T_{st})$ which seems to imply that closed sets exist in $(X,T)$ which would mean that T couldn't be the discrete topology?
What am I missing here ? 
 A: Implication $\implies$ is trivial, and you're not using the hypothesis for the converse in full force. You already know that every function $X\to \Bbb R$ is continuous, so you're allowed to choose a function. Given $x\in X$, our goal is to show that $\{x\}$ is open. Define the Dirac delta $\delta_x:X\to \Bbb R$ by $\delta_x(x)=1$ and $0$ otherwise. By assumption $\delta_x$ is continuous. So $\{x\} =\delta_x^{-1}((1/2,+\infty))$ is open.
A: The forward direction is incorrect as you state it: you need to note that if $X$ is discrete and $f: X \to \mathbb{R}$ is any function, then $f^{-1}[U]$ is open in $X$ for all open $U$ (not just $\mathbb{R}$) in $\mathbb{R}$. So $f$ is continuous.
If all real-valued functions on $X$ are continuous, let $A \subseteq X$. The function $\chi_A: X \to \mathbb{R}$ defined by $$\chi_A(x)=\begin{cases} 1 & \text{ if } x \in A\\
0 & \text{ if } x \notin A \end{cases}$$ 
is continuous by assumption. This implies that $\chi_A^{-1}[\{1\}] = A$ is closed as $\{1\}$ is closed in $\mathbb{R}$. As $A$ is arbitary, all subsets of $X$ are closed, which implies that $X$ has the discrete topology.
A: For ($\Leftarrow$) you could also use contraposition. Assume T is not the discrete topology then there exists a subset $U\subset X$, $X-U\notin T$ (U is not closed). Find a function that sends U to a closed subset of $\mathbb{R},$ for example:
$$f(x)=\begin{cases}
1& if& x\in X-U \\ 
0 &if& x\in U
\end{cases}
$$
Then since $f(U)=\{0\}$ is closed in $(\mathbb{R},T_{st})$ and $f^{-1}(\{0\})=U$ is not closed in $(X,T)$ it follows that $f$ is not continious.
