To prove energy conservation law, we need to show $\partial E(t)/ \partial t = 0$
\begin{equation} \frac{\partial E(t)}{\partial t} = \frac{1}{2} \int_0^\infty (2u_tu_{tt} +2c^2u_xu_{xt}+f(u)u_t) dx \end{equation}
\begin{equation} \frac{\partial E(t)}{\partial t} = \frac{1}{2} \int_0^\infty (2u_t(u_{tt}+f(u)) +2c^2u_xu_{xt}) dx \end{equation}
\begin{equation} \frac{\partial E(t)}{\partial t} = \frac{1}{2} \int_0^\infty (2c^2u_tu_{xx} +2c^2u_xu_{xt}) dx \end{equation}
\begin{equation} \frac{\partial E(t)}{\partial t} = c^2 \int_0^\infty \partial_x(u_tu_x) dx \end{equation}
\begin{equation} \frac{\partial E(t)}{\partial t} = c^2 ( u_tu_x|_{x=\infty} - u_tu_x|_{x=0} ) \end{equation}
For Dirichlet condition, $ u|_{x=0} = 0 \Rightarrow $ u_x|_{x=0} = 0 $u_t|_{x=0} = 0$. Incorrect! You meant not $u_x$ but ?
We also know $u$ vanishes at $\infty$, thus $\partial E(t) / \partial t = 0 $
For Newmann condition, $ u_x|_{x=0} = 0 $. We also know $u$ vanishes at $\infty$, thus $\partial E(t) / \partial t = 0 $
Sorry don't know how to strike through an equation.