This is a practice problem for an applied analysis qualifying exam. Obviously I know how to prove the Poincare Inequality for a general $H_0^1(\Omega)$, but here they want you to use a specialized strategy to prove it in one dimension. I figured the problem out...I think. But I'm suspicious of my strategy because I got $c=1$. Am I missing something obvious/doing something illegal?
Prove the Poincare inequality: for any $u \in H_0^1(0,1)$ $$ \int_0^1 u^2 dx \leq c \int_0^1 (u')^2 dx$$ for some constant $c>0$.
Hint: Write $u(x) = \int_0^x u'(s)ds$, then square this identity.
Proof:
Let $u(x) = \int_0^xu'(s)ds \Rightarrow |u(x)| \leq \int_0^x |u(s)|ds$.
Taking the supremum of both sides wrt $x$ we have $$||u||_\infty \leq \int_0^1 |u'(s)|ds.$$
We then square both sides (the involved quantities are nonnegative, so the direction of the inequality if preserved) and apply Cauchy Schwarz to obtain
$$||u||_\infty^2 \leq \bigg( \int_0^1 |u'(s)|ds\bigg) ^2 \leq \int_0^1(u'(s))^2ds \int_0^1 1^2 ds = ||u'||_{L^2(0,1)}^2.$$
Finally, we have $$||u||_{L^2(0,1)}^2 = \int_0^1 |u|^2 dx \leq \int_0^1 ||u||_\infty^2 dx = ||u||_\infty^2 \int_0^1 1 dx = ||u||_\infty^2.$$
This combined with the work above gives the desired result that $||u||_{L^2(0,1)}^2 \leq c||u'||_{L^2(0,1)}^2$ for $c=1$.
You haven't exactly followed the hint, but your proof seems correct.
As pointed out by Chee Han, you could follow the hint by squaring the given identity (using the Cauchy-Schwarz inequality like you did), integrating from $0$ to $1$ and exchanging the order of integration. If I'm not mistaken, this would give a better constant: $c = \frac 12$.
This could be further improved by using $u(x) = \int_0^x u'(s)ds$ for $0 < x \le \frac 12$ and $u(x) = -\int_x^1 u'(s)ds$ for $\frac 12 \le x < 1$, i.e. using the shortest path from $x$ to the boundary of $(0,1)$.
If you're looking for the optimal constant $c = \frac{1}{\pi^2}$, it is attained for $u(x) = \sin(\pi x)$. This can be seen e.g. via the Fourier transform.