In Bridges' Foundations of Real and Abstract Analysis, I'm working an exercise where I believe there's a typo. It's been on my mind for some days now and I'd be grateful for a comment or two. The exercise reads:
By a weight function on a compact interval $I=[a,b]$ we mean a nonnegative continuous function $w$ on $I$ such that if $f\in C(I)$ and $\int_I w(t)f(t) dt=0$, then $f=0$. Prove that $$\langle f,g\rangle=\int_a^b w(t)f(t) \overline{g(t)} \ dt,$$ defines an inner product on $L_2(I,\mathbf F)$ (where, as always, we identify two elements of $L_2(I,\mathbf F)$ that are equal almost everywhere). We denote the corresponding inner product space by $L_{2,w}(I,\mathbf F)$
I can prove all of the properties of an inner product, except $$\langle h, h\rangle =0\iff h=0.$$ In particular, the $\implies$ direction. I believe that $f\in C(I)$ should be $f\in L^2(I)$. For if $f\in L^2(I)$ and $$\langle h, h\rangle =0 \iff \int_I w(t)|h(t)|^2 \ dt=0,$$ then we can set $|h(t)|^2=f(t)$ and conclude by the assumption that $h=0$ a.e. On the other hand, $|h(t)|^2$ might not be continuous for some $h\in L^2(I)$ and hence I do not see that the requirement $f\in C(I)$ suffices.
There is more than a typo amiss in this Exercise. In short, no such weight function exists.
Without loss of generality, $I=[a,b] =[-1,1]$. Let $w$ be as described in the Exercise. Then $\int_0^1 xw(x)\,dx >0$. For if not, consider the function $f\in C(I)$ defined by $f(x)=x^+$ (positive part of $x$) for $x\in[-1,1]$. Clearly $f\not=0$, so we must have $\int_0^1 x w(x)\,dx=\int_I f(x)w(x)\,dx \not=0$. Because both $f$ and $w$ are non-negative, $\int_0^1 x w(x)\,dx>0$. Similarly, $\int_{-1}^0 x w(x)\,dx <0$. Now consider the function $f\in C(I)$ defined by $$ f(x):=\cases{x,&$-1\le x\le 0$,\cr cx,&$0\le x\le 1$,\cr} $$ where $c:=-\int_{-1}^0 xw(x)\,dx\Big/\int_0^1 xw(x)\,dx>0$. Then $\int_I f(x)w(x)\,dx=0$ but $f\not=0$.
Modifying my previous argument you can show that $\int_J w(x)\,dx >0$ for each interval $J\subset I$ of positive length.
Most likely, in the definition of "weight function" the assumption that the function $f\in C(I)$ is to be non-negative has been omitted. But here's an example of a weight function with this property for which the inner product is not positive definite. Let $K\subset I$ be the middle-fourths "fat Cantor set" (https://en.wikipedia.org/wiki/Smith%E2%80%93Volterra%E2%80%93Cantor_set). In particular, $K$ is closed and nowhere dense but has positive Lebesgue measure. Now define $w(x)=d(x,K)=\inf\{|y-x|: y\in K\}$ for $x\in I$. If $f\in C(I)$ is non-negative and $\int_I f(x)w(x)\,dx =0$, then (by continuity) $f(x)w(x)=0$ for all $x\in I$. Therefore $f(x)=0$ for all $x\in\{w>0\}$. But $\{w>0\}=K^c$ is dense in $I$; by continuity of $f$ we must have $f(x)=0$ for all $x\in I$. So this weight function $w$ satisfies the conditions of the Exercise. On the other hand, the function $h:=1_K$ has $\langle h,h\rangle=0$ but $\{x:h(x)\not=0\}$ has positive Lebesgue measure.
For the assertion of the Exercise to be true one needs a stronger hypothesis concerning the positivity of $w$; for example, that in addition to being continuous, $w(x)>0$ a.e.