Let $E$ be a metric space and $$S^1:=\{z\in\mathbb C:|z|=1\}.$$ Say that $f\in C^0(E,S^1)$ is inessential if $$f=e^{{\rm i}g}\tag1$$ for some $g\in C^0(E,\mathbb R)$. We can show that
- If $f\in C^0(E,S^1)$ with $f(E)\ne S^1$, then $f$ is inessential.
- If $f_i\in C^0(E,S^1)$ with $$f_1(x)\ne-f_2(x)\;\;\;\text{for all }x\in E\tag2$$ and $f_1$ is inessential, then $f_2$ inessential.
In Appendix 2.5 of Treatise on Analysis the following corollary is shown:
If we take a look at the proof, we see that the compactness assumption is not needed as long as $f:E\times[0,1]\to S^1$ is uniformly continuous.
Now, the following is inferred from that corollary:
It seems like the only reason why the closed ball in $\mathbb R^d$ is considered is that this is a compact metric vector space. Now I wonder, aren't we able to use precisely the same arguments to show that any uniformly continuous function $f:E\to S^1$ on a metric vector space is inessential?
EDIT
It was remarked that this can be solved by some facts about algebraic topology. However, I'm not familiar with algebraic topology. So, I'd really appreciate if someone could provide an elementary answer (maybe imposing suitable assumptions, which are satisfied in the special case of $\mathbb R^d$).


$\newcommand{\R}{\mathbb{R}}$ $\newcommand{\Z}{\mathbb{Z}}$ $\renewcommand{\S}{\mathbb{S}}$
The answer to the main question is no - continuous maps from a compact metric space into $\S^1$ can be essential. See the example:
To see that the second statement is true, assume for the contrary that such a $g$ exists. Consider the continuous function $h \colon \R \to \R$ given by $h(t) = g(e^{it})$. Now for each $t \in \R$ we have $$ e^{i h(t)} = e^{ig(e^{it})} = f(e^{it}) = e^{it}. $$ As in your Lemma 1, we see that $h(t)-t$ must be a multiple of $2\pi$. In other words, $t \mapsto h(t)-t$ is a continuous function from $\R$ to $2\pi \Z$, and as such has to be constant. Thus, $h(t) = t + 2k\pi$ for some fixed $k \in \Z$.
Coming back to our assumptions, we have $g(e^{it}) = t + 2k\pi$ for every $t \in \R$. But taking $t = 0$ and $t = 2\pi$ leads to a contradiction: $$ 2k\pi = g(e^{0 \cdot i}) = g(1) = g(e^{2\pi \cdot i}) = (2k+1) \pi. $$
Let us dig a little deeper. You asked:
Now, you already know the answer is no. But you're right that this reasoning is quite general. You should be able to check yourself that it gives us:
Such a map $r$ exists for the closed ball $E = \overline{B}^n$ (in fact, the proof of (Ap.2.6) relies on this) but not for the circle $E = \S^1$ (otherwise the example wouldn't work).
Finally, let me remark that there's no escaping from algebraic topology. This is algebraic topology, whether we like it or not. If you want to search for more, some vocabulary may be useful:
Of course, this is just vocabulary, in case you need it. Anyway, I strongly recommend A. Hatcher's brilliant and entertaining book.