Since $J$ is a functional (i.e. a map from a function space into the reals), the standard method of finding a minimizer is called calculus of variations. The idea is that, like in calculus, a minimum can be found by looking at where the derivative vanishes; anytime we change the function $x$ by a small amount, $J$ should increase compared to its value on $x$.
More concretely, let $\eta(t)$ be any continuously differentiable function with $\eta(0) = \eta(T) = 0$. Using $\eta$, we can deviate $x$ by considering the function $x + \epsilon\eta$, where $|\epsilon|$ is assumed to be small. Then $L(x + \epsilon\eta)$ has a minimum at at $\epsilon = 0$, so $\left.\frac{d}{d\epsilon}\right|_{\epsilon=0}L(x + \epsilon\eta) = 0$ where
$$L(x + \epsilon\eta) = \frac{1}{10}(x + \epsilon\eta)^2(T) + \frac{1}{2}\int_0^T(-(x + \epsilon\eta)^2 + (\dot{x} + \epsilon\dot{\eta})^2)dt. $$
The first term reduces to $\frac{1}{10}x^2$ since $\eta(T) = 0$, and so
$$ \frac{d}{d\epsilon}L(x + \epsilon\eta) = \frac{1}{2}\int_0^T(-2\eta(x + \epsilon\eta) + 2\dot{\eta}(\dot{x} + \epsilon\dot{\eta}))dt $$
$$\implies 0 = \left.\frac{d}{d\epsilon}\right|_{\epsilon=0}L(x + \epsilon\eta) = -\int_0^T\eta x + \int_0^T\dot{\eta}\dot{x}.$$
Using integration by parts and the fact that $\eta(0) = \eta(T) = 0$, we have
$$\int_0^T\dot{\eta}\dot{x} = \left.\dot{x}\eta\right|_0^T - \int_0^T\eta\ddot{x} dt = -\int_0^T\eta\ddot{x} dt$$
$$ \implies \int_0^T(\ddot{x} + x)\eta dt$$
for $any$ function $\eta$; the only way this can be true is if $x'' + x = 0$ on the interval $[0,T]$. This is a differential equation that can be solved by $x = ae^t + be^{-t}$ for any constants $a, b$. We can then use the initial conditions to determine the proper values of $a$ and $b$.