a.
We show that
∫0af(x)dx≤a.
To this end, write
a−∫0af(x)dx=a∫01f(x)dx−∫0af(x)dx=a∫a1f(x)dx−(1−a)∫0af(x)dx≥a∫a1f(a)dx−(1−a)∫0af(a)dx=0.
Here equality holds if and only if f(x)=1 for 0<x<1; at x=0 the function may take any non-negative value less than or equal to 1, and at x=1 it may take any value greater than or equal to 1.
Therefore,
f∈Cmax∫0af(x)dx=a.
b.
The required maximum is a if a≤1/2, and 1/(4(1−a)) if a>1/2. In both cases, it is achieved at an essentially unique function. In the former case, the maximum is achieved at f≡1 on the open interval (0,1); at x=0 the function may take any non-negative value less than or equal to 1, and at x=1 it may take any value greater than or equal to 1. In the latter case, the maximum is achieved at
f(x)={02(1−a)1if 0≤x<2a−1,if 2a−1<x<1;
at x=2a−1 the function may take any non-negative value less than or equal to 1/(2(1−a)), and at x=1 it may take any value greater than or equal to 1/(2(1−a)).
Let f be a function in C. Begin by noticing that
∫0a(f(x))2dx≤f(a)∫0af(x)dx≤(1−a1∫a1f(x)dx)(∫0af(x)dx)=1−a1(1−∫0af(x)dx)(∫0af(x)dx).
Next, as shown above,
∫0af(x)dx≤a.
Further, notice that
max{t(1−t):t≤a}={a(1−a)41if a≤1/2,if a>1/2;
in both cases, the maximum is achieved at a single point: at t=a in the former case, and at t=1/2 in the latter.
Consequently,
∫0a(f(x))2dx≤{a1/(4(1−a))if a≤1/2,if a>1/2.
If a≤1/2, then
∫0a(f(x))2dx=a
forces
∫0af(x)dx=a,
so f(x)=1 for 0<x<1, by the third paragraph above; at x=0 the function may take any non-negative value less than or equal to 1, and at x=1 it may take any value greater than or equal to 1.
If a>1/2, then
∫0a(f(x))2dx=4(1−a)1
forces
∫0af(x)dx=21(1)
and
∫0a(f(x))2dx=f(a)∫0af(x)dx,(2)
so
∫a1f(x)dx=21andf(a)=2(1−a)1.
The last two conditions force in turn f(x)=1/(2(1−a)), a≤x<1; at x=1 the function may take any value greater than or equal to 1/(2(1−a)).
We now show that (1) and (2) force
f(x)={02(1−a)1if 0<x<2a−1,if 2a−1<x<a.
Of course, f(0)=0, and at x=2a−1 the function may take any non-negative value less than or equal to 1/(2(1−a)). To prove this, consider the three sets below:
A={x:0<x<a,f(x)=0},
B={x:0<x<a,0<f(x)<f(a)},
C={x:0<x<a,f(x)=f(a)}.
Clearly, if x,y,z are members of A,B,C, respectively, then x<y<z.
Notice that B contains at most one point. Otherwise, consider two points b<b′ in B to contradict (2):
0<∫bb′f(x)(f(a)−f(x))dx≤∫0af(x)(f(a)−f(x))dx=0.
If A is empty, then so is B and C=(0,a) and
∫0af(x)dx=af(a)=2(1−a)a>21,
which contradicts (1).
Similarly, if C is empty, then again so is B and A=(0,a) and
∫0af(x)dx=0,
which contradicts again (1).
Consequently, neither A nor C are empty, supA=b=infC for some b in (0,a), and (0,b)⊆A and (b,a)⊆C.
Finally, b is determined by (1):
21=∫0af(x)dx=∫ba2(1−a)1dx=2(1−a)a−b,
so b=2a−1. The conclusion follows.