my question is regarding topology.
Given two topological spaces $X, Y$ and we know that $Y$ is $T_4$.
Let $f:X \rightarrow Y$ be a function such that for any continuous function $\phi:Y \rightarrow \mathbb{R}$, the composition $\phi \circ f$ is continuous.
Show that $f$ it self is continuous.
My attempt:
we want to show that for any open set $V$, $f^{-1}[V]$ is open. If we could find a function $g$ such that $g:Y \rightarrow \mathbb{R}$ would be zero in exactly $Y \setminus V$ and positive else where, then we could take the preimage of the open set $(0,\infty)$ which would be open in $X$ and be exactly $f^{-1}[V]$.
As I looked around, it seems we can build such a function when knowing that a set is $G_{\delta}$, and the space is normal but here we don't know that the set is $G_{\delta}$.
In the exam from which I took the question, the first question was to quote Urysohn's lemma, so the solution probably uses the lemma.
Any suggestions?