Q:

Find a non-zero function $f \in C(\mathbb{R}/\mathbb{Z} ; \mathbb{C})$ such that $||f||_2 = A$ and $||f||_\infty = B$.

(Tao Vol.2, P.113, Q.5.2.3) If $f \in C(\mathbb{R}/\mathbb{Z} ; \mathbb{C})$ is a non-zero function, show that $0 < ||f||_2 < ||f||_\infty$. Conversely, if $0 < A \le B$ are real numbers, show that there exists a non-zero function $f \in C(\mathbb{R}/\mathbb{Z} ; \mathbb{C})$ such that $||f||_2 = A$ and $||f||_\infty = B$. (Hint: let $g$ be a non-constant non-negative real-valued function in $C(\mathbb{R}/\mathbb{Z} ; \mathbb{C})$, and consider functions $f$ of the form $f = (c + dg)^{1/2}$ for some constant real numbers $c,d >0$.)
$C(\mathbb{R}/\mathbb{Z} ; \mathbb{C})$ denotes a collection of continuous functions whose domain is the quotient space of $\mathbb{R}$ modulo $\mathbb{Z}$ and range is complex number $\mathbb{C}$.
$$||f||_2^2 = \int_{[0,1]}|f(x)|^2 \le \sup_{x \in [0,1)} |f(x)|^2 = ||f||_\infty^2. $$
I am struggling with the opposite direction. I cannot see how $f = (c+dg)^{1/2}$ help the proof. I would appreciate if you give some help.

A:

You want:
$$ \|f\|_2=A, \qquad\|f\|_{\infty}=B $$
Which means
$$\|(c+dg)^{1/2}\|_2^2=A^2, \qquad\|(c+dg)^{1/2}\|_{\infty}^2=B^2$$
Try to express $\|(c+dg)^{1/2}\|_2^2$ and $\|(c+dg)^{1/2}\|_{\infty}^2$ in terms of $c,d$ and some suitable norms of $g$. Can you figure out how to conclude now? (Remember $|x|=x$ for $x\geq 0$)
EDIT:
We get the following linear system for $c,d$:
$$\begin{cases}
c+d\alpha=A^2\\
c+d\beta=B^2
\end{cases}$$
Where $$\alpha :=\int_{[0,1]}g = \|g\|_{1} \qquad  \beta := \text{sup}_{[0,1]}g = \|g\|_{\infty}$$

CASE $A=B:$ Can you guess at a possible solution?

CASE $A\neq B$: Choosing $g$ so that $0<\alpha<\beta$  (is it possible?), the system admits one and only one solution:
$$\begin{cases}
c=(\beta A^2 - \alpha B^2)/(\beta-\alpha)\\
d=(B^2-A^2)/(\beta-\alpha)
\end{cases}$$
We are almost done. We still have to be sure that $c,d$ be positive.
The condition $d>0$ leads to  $A<B$, which is automatic in this case. The condition $c>0$ leads to:
$$
\frac{\alpha}{\beta}<\frac{A^2}{B^2}
$$
Since $A,B$ are given, we have to look for suitable $g$ so that the inequality above is satisfied (remember that $\alpha, \beta$ depend on $g$). This can be achieved in at least two different ways: looking for an explicit $g$ satisfying this condition (this is a good exercise) or using the fact that the norms $\| \cdot \|_{\infty}$ and $ \| \cdot \|_{1}$ are not equivalent.

