A doubt about $\int_{0}^{1} f(x)~ \left(\int_0^x |f(t)| dt \right)~ dx=7$, if $\int_{0}^{1}f(x) dx=2, \int_{0}^{1} |f(x)| dx=4$ A question gives $f(x)$ as continuous and $f'(x)>0$ for all real values
of $x$ such that $\int_{0}^{1} f(x) dx=2, \int_{0}^{1} |f(x)| dx=4.$
So it is good to conclude that $f(x)=0$ will have exactly one real root in $(0,1)$, let us call it $x=a$.
The question then asks one to show that $$\int_{0}^{1} f(x)~ \left( \int_0^x  |f(t)| dt \right)~ dx=7.$$
My doubt/question is: Why the said integral is constant independent of the value of $a$ (that is unknown)? Please show it with necessary steps in any case.
 A: Although the integrand $(x,t)\mapsto f(x)\lvert f(t)\rvert$ depends on $a$, it will disappear when you do the integral on the triangle and leave you with dependence only via $\int_0^1 f$ and $\int_0^1\lvert f\rvert$, both of which you know (although they do depend on $a$ morally).  To spell it out completely:
Let $F(x):=\int_0^x f$.  Then
$$
\int_0^x \lvert f(t)\rvert\,\mathrm{d}t =
\begin{cases}
-F(x) & x\in[0,a]\\
F(x)-2F(a) & x\in[a,1]
\end{cases}
$$
and we have $F'=f$ by FTC.  Imposing our given conditions $F(1)=\int_0^1 f=2$ and $4=\int_0^1\lvert f\rvert=F(1)-2F(a)$ gives $F(a)=-1$.  So
\begin{align*}
&\int_0^1 f(x)\int_0^x \lvert f(t)\rvert\,\mathrm{d}t\,\mathrm{d}x\\
&=\int_0^a f(x)\int_0^x \lvert f(t)\rvert\,\mathrm{d}t\,\mathrm{d}x
+\int_a^1 f(x)\int_0^x \lvert f(t)\rvert\,\mathrm{d}t\,\mathrm{d}x\\
&=\int_0^a -f(x)F(x)\,\mathrm{d}x
+\int_a^1 f(x)\Big(F(x)-2F(a)\Big)\,\mathrm{d}x\\
&=\int_0^a -f(x)F(x)\,\mathrm{d}x
+\int_a^1 f(x)F(x)\,\mathrm{d}x
-2F(a)\int_a^1 f(x)\,\mathrm{d}x\\
&=-\frac12F(a)^2
+\frac12\Big[F(1)^2-F(a)^2\Big]
-2F(a)\Big[F(1)-F(a)\Big]\\
&=7.
\end{align*}
