Prove that if integral of a squared function is zero, then function is zero function I almost got this proof done but I can't seem to justify a little step. It goes:

Let $f$ be a real-valued, continuous function on $[a,b]$. Prove that if $$\int_a^b [f(x)]²\ dx = 0$$ then $$f(x)=0 \,\,\,\,\,\,\,\,\forall x \in [a,b]$$

I start by defining $$F(x) = \int_a^x [f(t)]²\ dt $$ Since $f$ is continuous, then $F'(x)=[f(x)]²\ge0 \;\;\;\;\; \forall x \in [a,b]$. Thus $F$ is increasing in $[a,b]$.
It's clear that $F(a)=0$ and by hypothesis $F(b)=0$. If I could justify why this means that $F$ must be a constant function in $[a,b]$ then my proof would be completed, since that would mean $F'(x)=0\;\;\forall x\in[a,b]$ and therefore $f(x)=0\;\;\forall x\in[a,b]$. 
Could anyone please tell me if there's a theorem or anything that would let me justify the key step???
 A: To complete the proof along the lines you started: $F$ is increasing (non-decreasing) on the entire interval. $F(a) = F(b)$. For any $x$ between $a$ and $b$, $F(a) \le F(x) \le F(b) = F(a)$. So the inequalities must be equalities.
A: let us assume that exists $x_0\in[a,b]$ with $f(x_0) \neq 0$, then
$[f(x_0)]^2>0$, notice $g(x)=[f(x)]^2\ge0$ is a continuous function.
so $x_0$ there is an $\epsilon>0$ such that for any $x\in[x_0-\epsilon,x_0+\epsilon] ,g(x)>0$ hence $0<\int_{x_0-\epsilon}^{x_0+\epsilon}{g(x)}=\int_{x_0-\epsilon}^{x_0+\epsilon}{[f(x)]^2}\le\int_{a}^{b}{[f(x)]^2}$, and it's a contradiction. 
so ther is no $x\in[a,b]$ with $f(x) \neq 0$ $\implies f(x)=0$
A: You wrotted "It's clear that  $F(a)=0$" why??
I had to prooved this statement too for an other reason, so i post here my full proof as it mays be usefull to somebody (as a student as the op so i hope it is correct).
By hypothesis $f(x)$ is continuous so $f^2(x)$ , as a multiplication of two continuous function, is too continuous. So according to fundomental theorem of calculus: $\exists F(x)$ uniformly continuous on $[a;b]$ that verifies: $F(b)-F(a)=\int_{a}^{b}f^2(x)dx \; and \; F'(x)=f^2(x)$. Because $F'(x)=f^2(x) \geq 0$ $F(x)$ is an increasing function. On the other side we have: $F(b)=F(a)$ So F(x) is a cste function as it musn't decrease. Obviously $F(a)=0=F(b)$ because if it wasn't the case the integral will be different from zero.
So we get $F(x)=cste=0$ so very easily $F'(x)=0=f^2(x)=f(x)f(x) \Rightarrow f(x)=0$
A: Here is a different approach that starts by proving a more general result:
$\displaystyle \int_a^b f^2=0 \rightarrow \left [\int_a^b f=0 \text{ and the set $S=\{x \in [a,b]:f(x)=0\}$ is dense in $[a,b]$}\right] \quad \dagger_1$
Once $\dagger_1$ is established, we must have that $f|_{[a,b]}$ is the constant function with the rule $f(x)=0$, as this is the only continuous function that satisfies the fact that the set $S$ is dense in $[a,b]$. To see this, suppose there is another function that is not the constant function $f|_{[a,b]}=0$. Then, clearly, there is an $z \in [a,b]: f(z) \gt 0$ or $f(z) \lt 0$. But $f$ is continuous at $z$, which means there is a neighborhood $[z+\delta,z-\delta]$ such that for any $x$ in the neighborhood, $f(x) \neq 0$, which contradicts the idea that $S$ is dense in $[a,b]$.

We will first prove that:
$$\int_a^bf^2=0 \rightarrow \int_a^bf=0$$
In general, one cannot deduce that $f$ is integrable if we know that $f^2$ is integrable. An appropriate counter example is the function:
$h(x)=\begin{cases}1 \quad &\text{ if $x\in \mathbb Q$}\\-1 &\text{ if $x \in \mathbb R\setminus Q$}\end{cases}$
, which is clearly not integrable but $h^2$ is.
We will show that under these particular conditions (i.e. when $\int_a^b f^2 =0$), it is not necessary to assume that $f$ is integrable.

First relevant observation:
By assumption, we know that $\displaystyle \int_a^b f^2 =0 \iff \inf_P U(f^2,P)=0$. By definition of infimum, we know that: $\forall \varepsilon \gt 0: \exists P \in \mathcal P_{[a,b]}: U(f^2,P) \lt \varepsilon \quad (*_1)$
Here we use the notation $\mathcal P_{[a,b]}$ to denote the set of all partitions of $[a,b]$.
Additionally, the notation $\displaystyle \inf_P U(f,P)$ is interpreted as the infimum of all upper sums of the function $f$ with any partition $P$ of $\mathcal P_{[a,b]}$.

Second relevant observation:
Suppose that $\displaystyle \inf_P U(f,P) = C \gt 0$. Consider an arbitrary $P=\{a,t_1,\cdots,t_{n-1},b\}$. Then we have that $U(f,P)=\displaystyle \sum_{i=1}^nM_i^f(t_i-t_{i-1}) \geq C$. In order for this to be true, there must be at least one $i \in \{1,2,\cdots,n\}: M_i^f \geq \frac{C}{b-a} \gt 0\quad (*_2)$. Of course, this generalizes to all $P \in \mathcal P_{[a,b]}$.
Referencing $(*_1)$, let $\varepsilon \lt \frac{C^2}{(b-a)^2} \quad (*_3)$. We know that there is a $P_{\varepsilon}=\{a,t_1,\cdots,t_{n-1},b\}:U(f^2,P_{\varepsilon}) \lt \varepsilon$. By $(*_2)$, we know that there is at least one $i \in \mathbb \{1,2,\cdots,n\}: M_i^f \geq  \frac{C}{b-a}$. What can we say about $M_i^{f^2}$?
We know that $f^2 |_{\mathbb R^+_{0}}$ is a strictly increasing function. This means that $M_i^f \geq  \frac{C}{b-a}\gt 0 \implies (M_i^f)^2 \geq \left(\frac{C}{b-a}\right)^2$. Now, suppose $\left|m_i^f \right| \leq M_i^f$. This means that $M_i^{f^2} =(M_i^f)^2$. Because of this, it follow that $M_i^{f^2} \geq \left(\frac{C}{b-a}\right)^2$. Suppose, instead, that $\left|m_i^f\right| \gt M_i^f$. Then we have that $M_i^{f^2}=(m_i^f)^2 \gt (M_i^f)^2 \geq (\frac{C}{b-a})^2$. Therefore, across all relevant cases, we have that $(M_i^f)^2 \geq \left( \frac{C}{b-a} \right)^2=\frac{C^2}{(b-a)^2}$. Why is this an issue? Obviously, for all $x \in [a,b]: f(x)^2 \geq 0$. This means that for any subinterval $[t_{j-1},t_j]:M_j^{f^2} \geq 0$. Because the subinterval $[t_{i-1},t_i]$ has the property that $M_i^{f^2} \geq \left(\frac{C}{b-a}\right)^2$, we are guaranteed that $U(f^2,P_{\varepsilon}) \geq \left(\frac{C}{b-a}\right)^2$. However, by $(*_1)$ with $(*_3)$'s definition, we have that $U(f^2,P_{\varepsilon}) \lt \left(\frac{C}{b-a}\right)^2$: a clear contradiction.

So we conclude that $\displaystyle \inf_P U(f,P) \leq 0 \quad (*_4)$.


Third relevant observation:
Next, suppose that $\displaystyle \sup_PL(f,P) = C \lt 0$. Consider an arbitrary $P=\{a,t_1,\cdots,t_{n-1},b\}$. Then we have that $L(f,P)=\displaystyle \sum_{i=1}^nm_i^f(t_i-t_{i-1}) \leq C \lt 0$. In order for this to be true, there must be at least one $i \in \{1,2,\cdots,n\}: 0\gt  \frac{C}{b-a}\geq m_i^f \quad (*_5)$. Of course, this generalizes to all $P \in \mathcal P_{[a,b]}$.
Referencing $(*_1)$, let $\varepsilon \lt \frac{C^2}{(b-a)^2} \quad (*_6)$. We know that there is a $P_{\varepsilon}=\{a,t_1,\cdots,t_{n-1},b\}:U(f^2,P_{\varepsilon}) \lt \varepsilon$. By $(*_5)$, we know that there is at least one $i \in \mathbb \{1,2,\cdots,n\}: m_i^f \leq  \frac{C}{b-a} \lt 0$. What can we say about $M_i^{f^2}$?
We know that $f^2 |_{\mathbb R^+_{0}}$ is a strictly increasing function. This means that $\left|m_i^f\right| \geq  \left|\frac{C}{b-a}\right|\gt 0 \implies (m_i^f)^2 \geq \left(\frac{C}{b-a}\right)^2$. Now, suppose $M_i^f \leq \left|m_i^f\right|$. This means that $M_i^{f^2} =(m_i^f)^2$. Because of this, it follow that $M_i^{f^2} \geq \left(\frac{C}{b-a}\right)^2$. Suppose, instead, that $M_i^f \gt \left|m_i^f\right|$. Then we have that $M_i^{f^2}=(M_i^f)^2 \gt (m_i^f)^2 \geq (\frac{C}{b-a})^2$. Therefore, across all relevant cases, we have that $(M_i^f)^2 \geq \left( \frac{C}{b-a} \right)^2=\frac{C^2}{(b-a)^2}$. Why is this an issue? Obviously, for all $x \in [a,b]: f(x)^2 \geq 0$. This means that for any subinterval $[t_{j-1},t_j]:M_j^{f^2} \geq 0$. Because the subinterval $[t_{i-1},t_i]$ has the property that $M_i^{f^2} \geq \left(\frac{C}{b-a}\right)^2$, we are guaranteed that $U(f^2,P_{\varepsilon}) \geq \left(\frac{C}{b-a}\right)^2$. However, by $(*_1)$ with $(*_6)$'s definition, we have that $U(f^2,P_{\varepsilon}) \lt \left(\frac{C}{b-a}\right)^2$: a clear contradiction.

So we conclude that $\displaystyle \sup_P L(f,P) \geq 0 \quad (*_7)$.


Conclusion
The following lemma related to upper and lower sums is relevant to the concluding step:

For any function $f$ defined on $[a,b]: \forall P_1,P_2 \in \mathcal P_{[a,b]}: L(f,P_1) \leq U(f,P_2) \quad (*_8)$

With $(*_8)$, we can use $(*_4)$ and $(*_7)$ to deduce that $\displaystyle \sup_P L(f,P)=0=\inf_P U(f,P) \quad (*_9)$. If the $\displaystyle \inf_P U(f,P) \lt 0$, then there would be partitions with upper sums less than $0$ (and therefore 'beneath' lower sums), contradicting $(*_8)$. Similarly, if $\displaystyle \sup_P L(f,P) \gt 0$, there would be partitions with lower sums greater than $0$ (and therefore 'above' upper sums), contradicting $(*_8)$.
$(*_9)$ lets us conclude that $\displaystyle \int_a^b f=0$, as desired.

With our results from $(*_9)$, we can now prove the following more powerful statement:

$\displaystyle \int_a^b f^2=0 \rightarrow \left [\int_a^b f=0 \text{ and the set $S=\{x \in [a,b]:f(x)=0\}$ is dense in $[a,b]$}\right]$

We will need to make use of the following lemma:

if $\forall x \in [a,b]: f(x) \gt 0$ and $f$ is an integrable function, then $\int_a^b f \gt 0 \quad (\dagger_2)$.

This lemma can be derived from the fact that if a function is integrable on $[a,b]$, then the set of points in $[a,b]$ where $f$ is continuous is dense in $[a,b]$.
Our previous work provides us with $\displaystyle \int_a^b f=0$. Next, suppose by contradiction that the set $S$ is not dense in $[a,b]$. Then there exists an open interval $(c,d) \subset [a,b]:$ such that $\forall x \in (c,d): f(x) \neq 0$. Of course, then, we have that for some $\varepsilon \gt 0: \forall x \in [c+\varepsilon, d-\varepsilon]: |f(x)| \gt 0$.  This result implies that $\forall x \in [c+\varepsilon, d-\varepsilon]: f(x)^2 \gt 0$. Because $f^2$ is integrable on $[a,b]$, an application of $\dagger_2$ then informs us that $\displaystyle \int_a^b f^2 \gt 0$, which is a contradiction.
Therefore, we conclude that the set $S$ must be dense on $[a,b]$, as desired.
