compute $\int_0^1 f(x)dx$ 
A continuous function $f:[0,1)\to [0,\infty)$ satisfies $f(x/2+1/2) = f(x)+1$ for $x\in[0,1)$ and $f(1-x) = 1/f(x)$ for all $x\in (0,1)$. Compute $\int_0^1 f(x)dx$.


This is question 11 from this problem set.

$f(x)$ cannot be zero for any $x>0$ since otherwise $f(1-x) = 1/f(x)$ would not hold. My first thought is to use some sort of substitution (e.g. $x\mapsto 1-x$, which gives $\int_0^1 f(x)dx=\int_0^1 \dfrac{1}{f(x)}$ ). It might be true that $f(x)+f(1/2-x)=1$ for $0\leq x\leq 1/2$ (or we could extend $f$ to negative $x$ if necessary). $f(0)+f(1/2) = 1$ follows from $f(1/2) = f(0) + 1$ and $f(1/2) = 1/f(1/2)\Rightarrow f(1/2)^2 = 1\Rightarrow f(1/2) = 1\Rightarrow f(0)=0$.
We know $f(1/2-x)=f(1-(1/2+x)) = 1/f(1/2+x) = 1/(f(2x)+1).$ So we need to equivalently show that $f(x)+1/f(x+1/2) = 1,$ or $f(x+1/2) = 1/(1-f(x)).$
However, I'm not sure how to proceed from here.
Then it might be useful to come up with recursive formulas for an integral and use that to find $\int_0^1 f(x)dx$. It might be useful to split $[0,1]$ into carefully chosen subintervals.
 A: The first thing to notice is that $f(x)+f(1/2-x)=1$ whenever $0<x<\frac{1}{2}$:
\begin{align*}
f(x)+f\left(\frac{1}{2}-x\right)&=\frac{1}{f(1-x)}+\frac{1}{f\left(\frac{1}{2}+x\right)}\\
&=\frac{1}{f(1-2x)+1}+\frac{1}{f(2x)+1}\\
&=\frac{1}{\frac{1}{f(2x)}+1}+\frac{1}{f(2x)+1}\\
&=\frac{f(2x)}{1+f(2x)}+\frac{1}{f(2x)+1}\\
&=1 \, .
\end{align*}
It then follows that
\begin{align*}\int_0^{1/2} f(x) \, dx &= \frac{1}{2} \int_0^{1/2} \left[f(x)+f\left(\frac{1}{2}-x\right)\right] \, dx\\
&=\frac{1}{2}\int_0^{1/2} 1 \, dx\\
&=\frac{1}{4}
\end{align*}
and so
\begin{align*}
\int_0^1 f(x) \, dx &= \int_0^{1/2} f(x) \, dx +\int_{1/2}^1 f(x) \, dx\\
&=\frac{1}{4} + \int_{1/2}^1 f(x) \, dx\\
&=\frac{1}{4} + \frac{1}{2}\int_0^1 f\left(\frac{u+1}{2}\right) \, du\\
&=\frac{1}{4} + \frac{1}{2}\int_0^1 \left[f(u)+1\right] \, du\\
&=\frac{3}{4} + \frac{1}{2}\int_0^1 f(u) \, du
\end{align*}
meaning that we have $\displaystyle\int_0^1 f(x) \, dx = \frac{3}{2}$.

Incidentally, $f$ is uniquely defined, and is a rather interesting function: e.g., it maps the dyadic rationals in $[0,1)$ surjectively to all rationals in $\left[0,\infty\right)$.
