Construct a function $g(x)$ orthogonal to $f(x)$ Consider Hilbert space $L^2( -1, 1)$ with inner product $\langle f(x),g(x) \rangle =\int_{-1}^{1} f(x)g(x)\mathrm dx$, where all functions are real-valued. Consider the function $f(x)=x-4x^3$. Construct a function $g(x)$ orthogonal to $f(x)$. Adjust $g(x)$ such that it has norm $1$: $\|g(x)\|=1$.  Is this answer unique ?
 A: The polynomials
$$ Q_n(x) = \sqrt{n+\tfrac{1}{2}}P_n(x) = \sqrt{n+\tfrac{1}{2}}\frac{1}{2^n n!}\frac{d^n}{dx^n}(x^2-1)^n $$
provide an orthornomal base of $L^2(-1,1)$ with respect to the standard inner product.
Since $x-4x^3=-\tfrac{7}{5}P_1(x)-\tfrac{8}{5}P_3(x)$ every function of the following form
$$ f(x) = \sum_{n\geq 0} q_n\, Q_n(x),\qquad \sum_{n\geq 0}q_n^2=1,\quad 7 \sqrt{14}\, q_1+8 \sqrt{6}\,q_3=0$$
is orthogonal to $x-4x^3$ and has a unit norm. Additionally it is pretty obvious that any even function with unit norm fulfills the wanted constraints.
A: For a general method: take any function $g$ which is not a scalar multiple of $f$.  Then the orthogonal projection of $g$ onto the orthogonal complement of $\langle f \rangle$ is $g - \frac{\langle f, g \rangle}{\langle f, f \rangle} f$.  This will be nonzero and orthogonal to $f$.
A: If $\int fg=0$, then $\int f(-g)=0$ is also true. Since $g\in L^2([-1,1])\Rightarrow -g\in L^2([-1,1])$, the answer is not unique.
However, it’s also worth noting that the answer you’ve given is in fact wrong.
A: As you have been told in the comments, taking $g=\frac f{\|f\|}$ will not work.
Since $f$ is an odd function,$$\int_{-1}^1f(x)\,\mathrm dx=0$$and this means that $f$ and the constant function $1$ are orthogonal. Since $\int_{-1}^11\mathrm dx=2$, you can take $g\equiv\frac1{\sqrt2}$. Of course, this answer is not unique.
