If $|f(x)+g(x)|=|f(x)|+|g(x)|$ and $|f(x)|=\lambda |g(x)|$ do we have $f(x)=\lambda g(x)$? Suppose we have two complex valued functions $f$ and $g$ and we know that $|f(x)+g(x)|=|f(x)|+|g(x)|$ and $|f(x)|=\lambda |g(x)|$ for all $x \in \mathbb{C}$ and some constant $\lambda$.
Is it true that $f(x)=\lambda g(x)$?
My guess would be that this is indeed correct since the triangle (in)equality tells us $f(x)$ and $g(x)$ lie on a straight line in the plane. But I am quite embarrassed that I cannot find a way to find a formal proof for that fact. Does anyone have nice argument for that?
 A: Fix any $x \in \mathbb{C}$. If $f(x) = 0$, then $g(x) = 0$ (from $|f(x)|= \alpha |g(x)|$) and we get $f(x) = \alpha g(x)$ easily. Otherwise, assume $f(x) \ne 0$ (and so $g(x) \ne 0$). Since we have $|f(x) + g(x)| = |f(x)|+|g(x)|$, there is some $\lambda > 0$ such that $f(x) = \lambda g(x)$. Taking modulus we get
$$|f(x)| = \lambda |g(x)| = \alpha |g(x)|$$
So $\lambda = \alpha$ and we also get $f(x) = \alpha g(x)$.
A: First I answer this question: when triangle inequality becomes equality? I work on inner product spaces over complex field:
$$\|a+b\|=\|a\|+\|b\|
\\\|a+b\|^2=\|a\|^2+\|b\|^2+2\|a\|\|b\|
\\(a+b)\cdot (a+b)=a\cdot a+b\cdot b+2\|a\|\|b\|
\\a\cdot a+b\cdot b+2a\cdot b=a\cdot a+b\cdot b+2\|a\|\|b\|
\\ \Rightarrow a\cdot b=\|a\|\|b\|
\\\Rightarrow |a\cdot b|=\|a\|\|b\|$$
so we have equality case in Cauchy–Schwarz inequality and it is well known that equality occurs in Cauchy–Schwarz inequality iff two vectors are dependent so we have:
$${\large b}=\alpha {\large a}$$ 
and also:
$$a\cdot b=\|a\|\|b\|\,\,\,\,\Rightarrow\,\,\,\,\overline \alpha \|a\|^2=\|a\|\|b\|\,\,\,\,\Rightarrow\,\,\,\,\overline \alpha={\|b\| \over \|a\|}$$
that means $\alpha$ has no imaginary part and precisely belongs to $\Bbb R^+$.
Now I return to your problem. In your conditions we have:
$$f(x)=\alpha (x)g(x)\,\,\,\,\text {so we have}\,\,\,\,\ \|f(x)\|=\alpha (x)\|g(x)\|$$ 
notice that from my first prove $\alpha$ depends on vectors. And If we have:
$$\|f(x)\|=\lambda \|g(x)\|$$
Then $\alpha (x)=\lambda$ (except when $g(x)$ is zero but that case is trivial and OK) which means $\alpha (x)$ must be a constant and finally we have:
$$f(x)=\lambda g(x)$$
A: The first equality tells you that, for every $x\in \mathbb C$, there exists some constant $0<\lambda(x)\in\mathbb R$ such that $f(x) = \lambda(x) g(x)$ (you can see that this is so even if one of them is $0$, since the other must be $0$ as well).
The second equality tells you that, for every $x\in\mathbb C$, there exists some constant $\mu(x)\in \mathbb C$ such that $|\mu(x)| = 1$ and that $f(x) = \mu(x)\alpha g(x)$
Using the two facts gives you $\mu(x)\alpha = \lambda(x)$ for every $x$, meaning that, since $\alpha, \lambda(x)\in\mathbb R^+$, you know that $\mu(x) \in\mathbb R^+$ and $|\mu(x)|=1$, meaning that $\mu=1$.
A: Lemma: If $\left|z+1\right|=\left|z\right|+1$, then $z=\left|z\right|$.
Proof: Subtracting the squares of equal quantities, we get
$$
\begin{align}
0
&=\overbrace{(z+1)(\overline{z+1})}^{\left|z+1\right|^2}-\overbrace{(z\overline{z}+2\left|z\right|+1)\vphantom{\overline{1}}}^{\left(\left|z\right|+1\right)^2}\\
&=z+\overline{z}-2\left|z\right|\\
&=2\operatorname{Re}(z)-2\left|z\right|
\end{align}
$$
That is, $\operatorname{Re}(z)=\left|z\right|$, which means that $\operatorname{Re}\left(\large\frac{z}{\left|z\right|}\right)=1$.
Since $\large\frac{z}{\left|z\right|}$ is on the unit circle and only one point on the unit circle has real part equal to $1$, we must have ${\large\frac{z}{\left|z\right|}}=1$. That is, $z=\left|z\right|$.
$\square$

From the first equation, we have
$$
\left|\frac{f(x)}{g(x)}+1\right|=\left|\frac{f(x)}{g(x)}\right|+1
$$
which the Lemma says means $\frac{f(x)}{g(x)}=\left|\frac{f(x)}{g(x)}\right|$.
Incorporating the second equation, we have
$$
\frac{f(x)}{g(x)}=\left|\frac{f(x)}{g(x)}\right|=\lambda
$$
Therefore, we have
$$
f(x)=\lambda g(x)
$$
