Let $f:X\rightarrow S^1$ be a continuous map from a path-connected topological space $X$ and let $p:\mathbb{R} \rightarrow S^1$ be the universal covering.
What is the condition when $f$ admits a lifting that there exists a continuous map $h: X \rightarrow \mathbb{R}$ such that $p \circ h = f$ ?
In general the following result holds for all connectet, locally connected topological spaces:
Let $p:X\longrightarrow Y$ be a cover and let $f:Z\longrightarrow Y$ be a continuous map. Let $z_{0}\in Z$ be a fixed basepoint and let $y_{0}=f(z_{0})\in Y,$ $x_{0}\in X$ such that $p(x_{0})=y_{0}$ (i.e., all the base point are constructed in the obvious way).
Hence, the continuous map $f$ admits a lift if and only if the following condition is satisfied:
$$ f_{\ast}\pi_{1}(Z,z_{0})\subseteq p_{\ast}\pi_{1}(X,x_{0}) $$
In particular, if $Z$ is simply connectd, your map always admits a lift. Moreover, here's an application to your specific case. First of all, you know $\pi_{1}(S^{1},y_{0})=\mathbb{Z}.$ As a useful criterion, if $\pi_{1}(Z,z_{0})$ is an abelian group of the form $(\mathbb{Z}/p_{1}^{q_{1}}\mathbb{Z})\times\cdots\times(\mathbb{Z}/p_{r}^{q_{r}}\mathbb{Z}),$ where $p_{1},\ldots,p_{r}$ are prime numbers, then you can deduce the group homomorphism $f_{\ast}$ must be $f_{\ast}=0$ and so your map $f$ admits a lift. This is, for example, the case of $Z=\mathbb{RP}^{n}$ for $n\geq2.$