$ L ^ 2 $ norm of a function and its derivative

You essentially have the right idea. Note that for any $x \in (a,b)$, $$f(x) = \int^x_a f'(t) dt$$ so by Cauchy-Schwarz $$\lvert f(x) \rvert \le \int^x_a \lvert f'(t) \rvert dt \le \left( \int^x_a 1^2 dt\right)^{1/2}\left( \int^x_a \lvert f'(t)\rvert^2 dt\right)^{1/2} \le (x-a)^{1/2} \| f'\|_{L^2(a,b)}.$$ But also $$f(x) = - \int^b_x f'(t) dt$$ so $$\lvert f(x) \rvert \le \int^b_x \lvert f'(t) \rvert dt \le \left( \int^b_x 1^2 dt\right)^{1/2}\left( \int^b_x \lvert f'(t)\rvert^2 dt\right)^{1/2} \le (b-x)^{1/2} \| f'\|_{L^2(a,b)}.$$ Since both these hold for all $x$, we can choose which one we use for a given $x$ which means $$\lvert f(x) \rvert \le [\min(b-x,x-a) ]^{1/2} \|f' \|_{L^2(a,b)}.$$ The functions in the minimum meet at $x= (b+a)/2$ with a value of $(b-a)/2$ so this gives $$\lvert f(x) \rvert \le \left(\frac{b-a}{2}\right)^{1/2} \| f'(x)\|_{L^2(a,b)}.$$ Now just square both sides and integrate to find $$\| f\|^2_{L^2(a,b)} \le \frac{(b-a)^2}{2} \|f'\|_{L^2(a,b)}^2$$ whereupon taking a square root yields your desired inequality.

NOTE: The bound $\min(b-x,x-a) \le (b-a)/2$ is actually fairly crude. You could improve this bound by actually integrating $$\int_a^b \min(b-x,x-a) dx = \frac{(b-a)^2}{4}$$ which would yield the slightly improved bound $$\| f\|_{L^2(a,b)} \le \frac{b-a}{2} \|f'\|_{L^2(a,b)}.$$