Let $x(t)$ be continuous on [-1,1] in a space with the $L^2$ norm (i.e. $\lVert x \rVert_2=\sqrt{\int_{-1}^{1} \lvert x(t)\rvert^2dt}$). I have to find the norm of the operator $f(x)$, where $f(x)=\int_{-1}^0x(t)dt -\int_{0}^1x(t)dt$.
I suspect $|f|=\sqrt2$, as
$$|f(x)|=\lvert\int_{-1}^0x(t)dt -\int_{0}^1x(t)dt \rvert$$ $$\le \int_{-1}^0 \lvert x(t) \rvert dt +\int_{0}^1 \lvert x(t) \rvert dt $$ $$= \int_{-1}^1 \lvert x(t) \rvert dt$$ $$\le \sqrt{\left( \int_{-1}^1 \lvert 1 \rvert^2 dt\right)}\sqrt{\left( \int_{-1}^1 \lvert x(t) \rvert^2 dt\right)}$$ by the Cauchy-Schwarz inequality for integrals.
$$\implies|f(x)| \le \sqrt2 \lVert x \rVert_2$$
However, I have no idea how to prove that $\sqrt 2$ is the norm by showing it's the infimum. Any suggestions?
You can make all your inequalities into equalities if you take $x=\frac1{\sqrt2}\,(1_{[-1,0]}-1_{[0,1]})$. As $\|x\|=1$ and $|f(x)|=\sqrt2$, you get that $\|f\|\geq\sqrt2$. And you have already proven the reverse inequality.
As this $x$ is not continuous, we need to approximate. Namely, we need $$ x_n(t)=\begin{cases} 1,&\ -1\leq t\leq -1/n\\ \ \\ -nt,&\ -1/n\leq t\leq 1/n\\ \ \\ -1,&\ 1/n\leq t\leq 1 \end{cases} $$