Hint: the basic assumption is that the Lagrangian $L(q(x),q'(x),x)$ is differentiable at $y:=(q(x),q'(x),x)$ and the variation $\delta L$ expresses the differentiability, in a suitable limit.
In other words, we are considering the increment ( $h$ is just a vector in $\mathbb R^3$, for all $x$, but the components $\delta q$ and $\delta q'$ are functions of $x$)
$$h:=(\delta q,\delta q',0)$$
and looking at
$$L(y+h)-L(y)=\langle \nabla L(y),h\rangle+O(\|h\|);~~(*)$$
the gradient $\nabla L(y)$ of $L$ at $y$ is
$$\nabla L(y)=\left(\frac{\partial L}{\partial q},\frac{\partial L}{\partial q'},\frac{\partial L}{\partial x}\right) $$
and, by definition,
$$y+h=(q(x)+\delta q,q'(x)+\delta q',x).$$
- Remark: boundary conditions
In variational problems, the vector $h$ is not completely arbitrary: in fact, if we consider small variations _(i.e. $\delta q$) of the function $q:x\mapsto q(x)$ we need to impose boundary conditions on the components of $h$: such conditions are depending on the specific variational problem under exam. They are motivated by the variational approach and usually "kill" unfriendly boundary terms (at least in classical variational problems: in quantum field theory one can accept and subsequently work with boundary terms).
For example, in presence of the variational problem
$$S[q]:=\int_a^b L(q(x),q'(x),x)dx $$
we would be interested in all small variations $\delta q$ of $q=q(x)$ s.t. $\delta q(a)=\delta q(b)=0$.
If we expand $(*)$ using the definition of gradient and scalar product, we arrive at
$$L(q(x)+\delta q,q'(x)+\delta q',x)-L(q(x),q'(x),x)=\frac{\partial L}{\partial q}\delta q+\frac{\partial L}{\partial q'}\delta q'+O(\|h\|). $$
$$\delta q:=\epsilon\varphi, $$
$$\delta q':=\epsilon\varphi' $$
where $\varphi$ is any function satisfying suitable boundary conditions, and $\epsilon$ is a parameter. In this setting we are considering the increment
$$h=(\epsilon\varphi,\epsilon\varphi',0)$$
around $y=(q(x),q'(x),x)$ and the first variation $\delta L$ of $L$ is defined as
$$\delta L:=\frac{dL}{d\epsilon}|_{\epsilon=0}:=\lim_{\epsilon\rightarrow 0}
\frac{L(q(x)+\epsilon\varphi,q'(x)+\epsilon\varphi',x)-L(q(x),q'(x),x)-\epsilon\left(\frac{\partial L}{\partial q}\varphi+\frac{\partial L}{\partial q'}\varphi'\right)+O(\epsilon^2)}{\epsilon}. $$
I personally find this notation quite good.
There is no need for any calculus of variation. Ordinary calculus is enough.
For simplicity of derivation, we will use complex numbers to represent points on the plane.
Let $z(s) = x(s) + i y(s)$ and WOLOG, we will assume $z(0) = 0$. We can express the
position on our curve as an integral:
$$z(t) = \int_0^t z'(s)\;ds$$
Let $\theta(t) = \begin{cases} 1 & t > 0\\ 0 & t \le 0\end{cases}$ be the step function.
The center of mass is given by
$$\begin{align}z_{cm}
&= \frac{1}{L} \int_0^L z(t) dt
= \frac{1}{L} \int_0^L \int_0^t z'(s)\;ds\; dt\\
&= \frac{1}{L} \iint_{[0,L]^2} \theta(t-s) z'(s)\;ds\; dt
= \int_0^L \left(1-\frac{s}{L}\right) z'(s)\;ds
\end{align}
$$
The moment of inertia w.r.t. $z(0)$, the origin, is given by
$$\begin{align}
\mathcal{M}_0
&= \int_0^L |z(s)|^2 ds
= \int_0^L \left(\int_0^t z'(s_1)ds_1\right)\left(\int_0^t \bar{z}'(s_2) ds_2\right) dt\\
&=\iiint_{[0,L]^3} \theta(t-s_1)\theta(t-s_2) z'(s_1) \bar{z}'(s_2) ds_1 ds_2 dt\\
&=\iiint_{[0,L]^3} \theta(t-\max(s_1,s_2)) z'(s_1) \bar{z}'(s_2) ds_1 ds_2 dt\\
&= \iint_{[0,L]^2} \left(L - \max(s_1,s_2)\right) z'(s_1) \bar{z}'(s_2) ds_1 ds_2
\end{align}$$
and hence the moment of inertia w.r.t. the center of mass is
$$\mathcal{M}_{cm} = \mathcal{M}_0 - L |z_{cm}|^2 = L \iint_{[0,L]^2} \Lambda(s_1,s_2) z'(s_1) \bar{z}'(s_2) ds_1 ds_2$$
where
$$\begin{align}\Lambda(s_1,s_2)
&= 1 - \max\left(\frac{s_1}{L},\frac{s_2}{L}\right) - \left(1-\frac{s_1}{L}\right)\left(1-\frac{s_2}{L}\right)\\
&= \left( 1 - \max\left(\frac{s_1}{L},\frac{s_2}{L}\right)\right)\min\left(\frac{s_1}{L},\frac{s_2}{L}\right)
\end{align}$$
Since $|z'(s)| \equiv 1$ and $\Lambda(s_1,s_2) > 0$ for $(s_1,s_2) \in (0,L)^2$, we can bound $\mathcal{M}_{cm}$ as
$$\mathcal{M}_{cm} \le L \iint_{[0,L]^2} \Lambda(s_1,s_2) |z'(s_1)||z'(s_2)| ds_1 ds_2
= L \iint_{[0,L]^2} \Lambda(s_1,s_2) ds_1 ds_2$$
Notice the equality in above inequality is achieved when and only when $z'(s)$ is a constant.
We can conclude $\mathcal{M}_{cm}$ is largest for straight lines.
Best Answer
Consider dilating the curve by a constant $c$. The moment of inertia of the dilated curve is proportional to $c^2$. The distance between the original curve and the dilated curve is proportional to $c-1$. What does this imply for the statement?
Edit: Okay, if we're not allowed to dilate the string, we can still change its curvature. Define a family of curves $\gamma_r$ for $r>0$ by $$\gamma_r(s) = \left(r\cos(s/r), r\sin(s/r)\right).$$ Then you can check that $\gamma_r$ is as continuous as you need it to be, and the moment of inertia for any given length is a strictly increasing function of $r$; it has no local extrema.