Given a function $f:\mathbb{R} \rightarrow \mathbb{C}$ that is continuous and differentiable everywhere. Is it true that I can write $f(t)$ as:
$$f(t) = r(t)e^{i\theta(t)}$$
for some $r(t)$ and $\theta(t)$ that are real, continuous and differentiable everywhere.
Intuitively the answer seems yes to me. I can choose $$r(t) = |f(t)|$$
I can start with $$\theta(t) = arg(f(t))$$ for nonzero $f(t)$ and modify it to remove discontinuities by adding or subtracting $2\pi$ at discontinuous t values. At values where $f(t) = 0$, I can choose $\theta(t)$ to maintain continuity.
But I'm interested in a rigorous answer. Thanks.
A counterexample: $f:\mathbb{R} \to \mathbb{C}$ defined by $f(0)=0$ and $$ f(t) = t^2 e^{i/t} = t^2 (\sin \frac 1t + i \cos \frac 1t) $$ is differentiable everywhere.
Now assume that $f(t) = r(t)e^{i\theta(t)}$ with continuous, real-valued functions $r$ and $\theta$. Then $r(t) = \pm t^2$ for all $t$ and therefore $$ e^{i(\theta(t)- \frac 1t)} = \pm 1 $$ for all $t \ne 0$. It follows that for each $t \ne 0$ there is a $ k(t) \in \Bbb Z$ such that $$ \theta(t)- \frac 1t = \pi k(t) \, . $$ But the left hand side is continuous, so that $k(t) $ must be constant for $t > 0$. It follows that $\theta$ is not continuous at $t=0$, which is a contradiction to our assumption.
Remark: With small modifications we can make the counterexample continuously differentiable: $$ f(t) = t^3 e^{i/t} $$ or even infinitely often differentiable: $$ f(t) = e^{-1/t^2 + i/t} $$