$\lim\limits_{n\to \infty} \int_0^1 |f(x)-a_nx-b_n| dx=0$ implies $(a_n)_n,(b_n)_n$ are convergent 
Let $f:[0,1] \to \mathbb R$ be a continuous function and the sequences $(a_n)_n,(b_n)_n$ s.t. $$\lim_{n\to \infty}  \int_0^1 |f(x)-a_nx-b_n| dx=0.$$ Prove that $(a_n)_n,(b_n)_n$ are convergent.

I know that $$\left|\int_0^1f(x)dx\right| \le \int_0^1|f(x)|dx.$$ Can somebody help me, please?
 A: Consider the metric space $E$ of the continuous functions on $[0,1]$, with the distance $d : E \times E \rightarrow \mathbb{R}_+$ defined by
$$d(f,g)=\int_0^1 |f(t)-g(t)| \mathrm{dt}$$
Consider the subspace $A$ of affine functions. 
Consider the application $\varphi : [0,1]^2 \rightarrow E$ defined for all $(a,b) \in [0,1]^2$ by 
$$\varphi(a,b) = \lbrace f : t \rightarrow (b-a)t+a \rbrace$$
Then it is easy to see that $\varphi$ is continuous. Moreover, its image is precisely $A$. You deduce that $A$ is a compact subset of $E$ (as a continuous image of the compact $[0,1]^2$), and therefore $A$ is closed.
This proves, in the case of your question, that such a function $f$ has to be affine, as a limit of the closed set of affine functions.
So there exists $a,b$ such that $f(x)=ax+b$. You can rewrite the hypothesis
$$\int_0^1 |(a-a_n)x +(b-b_n)| \mathrm{dx} \rightarrow 0$$
It is easy now to prove that the only possibility is that $a_n \rightarrow a$ and $b_n \rightarrow b$.
A: Here is an elementary proof: 
Lemma
If $\int_0^{1} |f(x)-f_n(x)|dx \to 0$ (with $f,f_1,f_2,...$ continuous) and $F(x)=\int_0^{x} f(y)dy,F_n(x)=\int_0^{x} f_n(y)dy$ then $\int_0^{1} |F(x)-F_n(x)|dx \to 0$.
Proof of lemma:  $$\int_0^{1} |F(x)-F_n(x)|dx \leq \int_0^{1}\int_0^{x} |f(y)-f_n(y)|dy dx$$ $$ =\int_0^{1}\int_y^{1} |f(y)-f_n(y)|dxdy =\int_0^{1} (1-y)|f(y)-f_n(y)|dy \leq \int_0^{1} |f(y)-f_n(y)|dy$$. This proves the lemma.
Now the hypothesis implies $\int_0^{1} (a_nx+b_n) dx$ converges and the lemma shows that $\int_0^{1} (a_nx^{2}/2+b_nx) dx$ also converges. From these two it is quite easy to show that $(a_n)$ and $(b_n)$ both converge. 
Another proof using basic measure theory. It is given that $a_nx+b_n \to f$ in $L^{1}$. This implies there is a subsequence which converges almost everywhere, say $a_{n_k}x+b_{n_k} \to f(x)$ almost everywhere. Form this (using two values of $x$ for which convergence holds) we see that $a_{n_k}$ and $b_{n_k}$ both converge, say to $a$ and $b$ so $f(x)=ax+b$ for some $a$ and $b$. Note that this last equation uniquely determines $a$ and $b$. In fact $b=f(0)$ and $a =f(1)-f(0)$  We can now argue that every subsequence of $a_{n_k}$ has a subsequence converging to the same limit, so $\{a_n\}$ is convergent. Similarly $\{b_n\}$ is convegent. 
A: Here is a elementary proof without Fubini, or any measure theory or TVS theory at all. Set
$\tag1 F(t)=\int_0^tf(x)dx\ \text{and}\ F_n(t)=\int_0^t(a_nx+b_n)dx.$
Then, $|F_n(t)-F(t)|\le \int_0^t|f(x)-(a_nx+b_n)|dx\le \int_0^1|f(x)-(a_nx+b_n)|dx\to 0$ so $F_n$ converges uniformly to $F$. That is,
$\tag2 \frac{a_n}{2}t^2+b_nt\to \int_0^tf(x)dx$
so it follows that
$\tag3 \frac{a_n}{2}+b_n\to \int_0^1f(x)dx$
$\tag4 \frac{a_n}{8}+\frac{b_n}{2}\to \int_0^{1/2}f(x)dx$
from which it follows that $a_n\to a$ and $b_n\to b$ for the real numbers $a,b$ which can be calculated in terms of the integrals on the RHS of these expressions. Now
$\int_0^1|f(x)-(ax+b)|dx=\int_0^1|f(x)-(ax+b)+(a_nx+b_n)-(a_nx+b_n)|dx\le$
$\int_0^1|f(x)-(a_nx+b_n)|dx+\int_0^1|(ax+b)-(a_nx+b_n)|dx\to 0$ as $n\to \infty.$ It follows that
$\tag5 \int_0^1|f(x)-(ax+b)|dx=0$
and since the integrand is continuous, that
$\tag6 f(x)-(ax+b)=0.$
A: We have $|\int_0^1 (f(x)-a_nx-b_n) dx| \le \int_0^1 |f(x)-a_nx-b_n| dx.$
Hence $\int_0^1 (f(x)-a_nx-b_n) dx  \to 0$.
Since $\int_0^1 (f(x)-a_nx-b_n) dx = \int_0^1 f(x) dx-\frac{1}{2}a_n-b_n$, we see:
$\frac{1}{2}a_n+b_n \to \int_0^1 f(x) dx$.
Can you proceed ?
A: Let be $L_n(x) = a_n x + b_n$. The hypothesis says that $L_n\to f$ in $L^1$. Consider the vector subspace generated by the polynomials of degree $\le 1$ and $f$. Obviously, is finite-dimensional. But in finite dimension all the norms are equivalent, so the convergence $L_n\to f$ is uniform...
