Part A
In this problem, the Lagrangian is
\begin{equation}
L=\frac{\sqrt{1+u'^2}}{c(x,u(x))}
\end{equation}
We need to calculate the Euler-Lagrange equation:
\begin{equation}
\frac{\partial L}{\partial u} - \frac{\partial}{\partial x} \frac{\partial L}{\partial u'} = 0
\end{equation}
Calculating each term
\begin{equation}
\frac{\partial L}{\partial u} = -\frac{\sqrt{1+u'^2}}{c^2\left(x,u(x)\right)} \frac{\partial c}{\partial y}
\end{equation}
\begin{equation}
\frac{\partial L}{\partial u'} = \frac{1}{c\left(x,u(x)\right)} \frac{u'}{\sqrt{1+u'^2}}\\
\frac{\partial}{\partial x} \frac{\partial L}{\partial u'} =
-\frac{1}{c^2\left(x,u(x)\right)} \frac{u'}{\sqrt{1+u'^2}} \left(\frac{\partial c}{\partial x}+\frac{\partial c}{\partial y}u'\right)
+\frac{1}{c\left(x,u(x)\right)}\frac{1}{\left(1+u'^2\right)^{3/2}} u''
\end{equation}
Plugging into $(2)$:
\begin{equation}
-\frac{\sqrt{1+u'^2}}{c^2\left(x,u(x)\right)} \frac{\partial c}{\partial y}
+\frac{1}{c^2\left(x,u(x)\right)} \frac{u'}{\sqrt{1+u'^2}} \left(\frac{\partial c}{\partial x}+\frac{\partial c}{\partial y}u'\right)
-\frac{1}{c\left(x,u(x)\right)}\frac{1}{\left(1+u'^2\right)^{3/2}}u''
=0
\end{equation}
We can simplify a little bit
\begin{equation}
\frac{1}{c\left(x,u(x)\right)^2\sqrt{1+u'^2}}\left(u'\frac{\partial c}{\partial x} - \frac{\partial c}{\partial y}\right)
-\frac{1}{c\left(x,u(x)\right)}\frac{1}{\left(1+u'^2\right)^{3/2}} u''
=0
\end{equation}
\begin{equation}
\frac{1}{\sqrt{1+u'^2}}\left(u'\frac{\partial c}{\partial x} - \frac{\partial c}{\partial y}\right)
=\frac{c\left(x,u(x)\right)}{\left(1+u'^2\right)^{3/2}} u''
\end{equation}
Will type up B later, Or if someone else wants to volunteer below. Since in part (b) the Lagrangian doesn't depend on $x$ explicitly, we can calculate the Hamiltonian ($H=u'L_{u'}-L$) and set it to a constant.