$ \int_0^1 |f(x)-t| \, dx \le \frac{(1-t)^2+1}{2}$ Let $ f(x)>0$, $f''(x)>0$, and  $ \int_0^1 f(x)\,dx=1 $, for $t\in \mathbb R $, prove that:  $$ \int_0^1 |f(x)-t| \, dx  \le \frac{(1-t)^2+1}{2}.$$
This inequality maybe is very interesting. But I can't prove this.
sorry,everyone ,This Problem $f''(x)>0$ edit $f''(x)<0$,and other didn't change. 
 I think  this is  true. 
I mean 
:Let $ f(x)>0$, $f''(x)<0$, and  $ \int_0^1 f(x)\,dx=1 $, for $t\in \mathbb R $, then  we have   $$ \int_0^1 |f(x)-t| \, dx  \le \frac{(1-t)^2+1}{2}.$$
 A: Edit: This is true for sure when $\min f\geq t$, $\max f\leq t$, or  $\min f < t< \max f$ and $t\geq 4$. Note that it always holds for $t\leq 0$ and $t\geq 4$ for trivial reasons, as observed by Ivan Loh. Other than that...? It is apparently false in general for $0<t<2$. If Ivan Loh's example works, it remains to decide whether this is true for $2\leq t<4$.
Case 1: $\min f\geq t$. Then 
$$\int_0^1|f(x)-t|dx=\int_0^1(f(x)-t)dx=\int_0^1f(x)dx-\int_0^1tdx=1-t\leq\frac{(1-t)^2+1}{2} .$$
Case 2: $\max f\leq t$. Then
$$
\int_0^1|f(x)-t|dx=\int_0^1(t-f(x))dx=\int_0^1tdx-\int_0^1f(x)dx=t-1\leq\frac{(1-t)^2+1}{2} .
$$
Case 3: $\min f < t< \max f$. By the intermediate value theorem there exists $x\in[0,1]$ such that $f(x)=t$. Since $f$ is strictly convex and since $t>\min f$, there exist actually $0\leq x_1< x_2\leq 1$ such that $f\geq t$ on $[0,x_1]\cup[x_2,1]$ and $f\leq t$ on $[x_1,x_2]$. Note that we may have $x_1=0$ or $x_2=1$. Now
$$
\int_0^1|f(x)-t|dx=\int_0^{x_1}(f(x)-t)dx+\int_{x_2}^1(f(x)-t)dx+\int_{x_1}^{x_2}(t-f(x))dx
$$
$$
=1-t+2t(x_2-x_1)-2\int_{x_1}^{x_2}f.
$$
Now this is $\leq \frac{(1-t)^2+1}{2}$ if and only if
$$
t^2-4(x_2-x_1)t+4\int_{x_1}^{x_2}f\geq 0.
$$
One recovers the fact that it holds for $t\geq 4$. But I don't really know what to do with that next...
A: I will present a counter-example for $t \in (0,4)$.
Set
$$f(x) = \epsilon + \begin{cases}c_1 \, (x-x_0)^4 & x \le x_0, \\ c_2 \, (x-x_0)^4 & x > x_0.\end{cases}$$
Obviously, we have $f \in C^2([0,1])$. For $c_1,c_2,\epsilon > 0$ and $x_0 \in (0,1)$, you have $f > 0$, $f'' > 0$.
Now, let $c_1, \epsilon$ small and $x_0$ big be given, such that $f(0) < t$ (and hence, $f < t$ on $[0,x_0]$).
We have
$$\int_0^1 f \, d x = \epsilon + \frac{c_1}{5} \, x_0^5 + \frac{c_2}{5}\,(1-x_0)^5,$$
hence, we choose $c_2 = \frac{5}{(1-x_0)^5}\big(1 - \epsilon - \frac{c_1}5 \, x_0^5\big)$, such that the integral equals one.
Let us look for $f(\tilde x) = t$ for $\tilde x \in (x_0,1)$.
We have
$$\tilde x = x_0 + (1-x_0)^{5/4} \, \frac{t-\epsilon}{5\,(1-\epsilon-c_1\,x_0^5/5)} \le x_0 + (1-x_0)^{5/4} < 1$$
for $c_1, \epsilon$ small enough.
Now, we have
\begin{align*}\int_0^1 |f-t|\,dx &\ge \int_0^{x_0} | f - t | \, dx+ \int_{\tilde x}^1 f -t \, d x.
\end{align*}
For the first integral, we obtain
\begin{align*}\int_0^{x_0} | f - t | \, dx= t\,x_0 - \epsilon - \frac{c_1}{5} \, x_0^5.
\end{align*}
For the second, we have
\begin{align*}
\int_{\tilde x}^1 f - t \, d x &\ge
\int_{x_0 + (1-x_0)^{5/4} }^1 c_2 \, (x-x_0)^4 + \epsilon  \, d x - t\,(1-\tilde x) \\
&= \frac15 \, c_2 \, \Big( (1-x_0)^5 - (1-x_0)^{25/4} \Big) + \epsilon\,(1-x_0-(1-x_0)^{5/4}) - t \,(1-\tilde x) \\
&\ge \Big( 1 - (1-x_0)^{5/4} \Big) \, (1-\epsilon-\frac{c_1}5\,x_0^5) + \epsilon\,(1-x_0-(1-x_0)^{5/4}) - t \,(1-\tilde x)
\end{align*}
Alltogether, we have
\begin{align*}
 \int_0^1 |f-t| \, d x
 &\ge
 t\,x_0 - \epsilon - \frac{c_1}{5} \, x_0^5
  \\&\quad+ \Big( 1 - (1-x_0)^{5/4} \Big) \, (1-\epsilon-\frac{c_1}5\,x_0^5) + \epsilon\,(1-x_0-(1-x_0)^{5/4}) - t \,(1-\tilde x) \\
 &=
 t\,(x_0+\tilde x - 1)
 + \Big( 2 - (1-x_0)^{5/4} \Big) \, (-\epsilon-\frac{c_1}5\,x_0^5)
 \\&\quad+ \Big( 1 - (1-x_0)^{5/4} \Big)
 + \epsilon\,(1-x_0-(1-x_0)^{5/4})
\end{align*}
Note that the right-hand side converges to $t + 1$ if $x_0, \epsilon, c_1$ are chosen appropriate.
Since $t+1 >  \frac{(1-t)^2 +1}{2}$ for $t \in (0,4)$, we have
$$\int_0^1 | f - 1| \, dx > \frac{(1-t)^2+1}2.$$
