We can make rigorous the argument given by Flounderer using the comment given by Varun Vejalla. Also we can prove that the identity function is indeed a maximizer computing the second variation which turns out to be strongly concave.
Using the change of variable $x=f(t)$ we have
$$
\int_0^1 f(x) f^{-1}(x)\,dx=\int_0^1 f(f(t))f'(t) t \,dt.
$$
We compute the Euler-Lagrange equation: let $h(t)=f(t)+\delta g(t)$ where $g\in S:=\{G \in C^1[0,1] : g(0)=g(1)=0\}$ and $\delta$ real number.
We
$$
u[g](\delta)=\int_0^1 t (f(t)+\delta g(t))(f(f(t)+\delta g(t))+\delta g(f(t)+\delta g(t)))\,dt
$$
Now the Euler-Lagrange equations is
$$0=\frac{d}{d\delta}u[g](0)=\int_0^1 t \{ g'(t) f(f(t))+ f'(t) f'(f(t)) g(t)+f'(t) g(f(t)) \}\,dt=\int_0^1 t [f(f(t))g(t)]' \,dt+ \int_0^1 t f'(t) g(f(t)) \,dt.$$
Integrate by parts the first integral and substitute $f(t)=x$ to obtain
$$
-\int_0^1 f(f(t)) g(t)+\int_0^1 g(x) f^{-1}(x) dx=\int_0^1 g(t) \lvert f^{-1}(t)-f(f(t))\rvert\, dt \quad \forall g\in S.
$$
An application of the fundamental lemma gives
$$
f^{-1}(t)=f(f(t)),\quad \text{that is} \quad t=f(f(f(t))).
$$
By symmetry we can suppose $t\leq f(t)$ and since $f$ increases we obtain $t\leq f(t)\leq f(f(t))\leq f(f(f(t))=t$. Hence $f(t)=t$ is the unique critical point for the functional.
We can prove that $f(t)=t$ is indeed a maximum since $u''[g](0) \leq - \alpha \int_0^1 g^2(t)\,dt$ for some $\alpha>0$.
If we compute the second variation in $\delta=0$ in Flounderer's argument we obtain $-2 \int_0^1 g^2(t)\, dt$, namely the strongly concave condition with $\alpha =2$. We can make the argument rigorous using the approach above