Prove that if $f''(x)+25f(x)=0$ then $f(x)=Acos(5x)+Bsin(5x)$ for some constants $A,B$ Suppose $f: \mathbb{R} \rightarrow \mathbb{R}$ is twice differentiable.
Prove that if $f''(x)+25f(x)=0$ then $f(x)=Acos(5x)+Bsin(5x)$ for some constants $A,B$

Consider $g(x):= f(x)-Acos(5x)-Bsin(5x)$ where $A$ and $B$ are chosen so that $g(0)=g'(0)=0$ [this portion is given, so can someone explain why it is important?]
For reference, we note that
$g(x):= f(x)-Acos(5x)-Bsin(5x)$
$g'(x):= f'(x)+5Asin(5x)-5Bcos(5x)$
$g''(x):= f''(x)+25Acos(5x)+25Bsin(5x)$
Consider the derivative of $\frac{25}{2}g(x)^2+\frac{1}{2}g'(x)^2$
$25g(x)g'(x)+g''(x)g'(x)$ if and only if $g'(x)[25g(x)+g''(x)]$
Following substitution, we conclude that 
$g'(x)[25g(x)+g''(x)]=g'(x)(0)=0$
Therefore, by the Constancy Theorem, $\frac{25}{2}g(x)^2+\frac{1}{2}g'(x)^2=C_0$, where $C_0$ is a constant
$25g(x)^2+g'(x)^2=C$, where $C$ is a constant
Thus, 
$25(f(x)-Acos(5x)-Bsin(5x))^2 + (f'(x)+5Asin(5x)-5Bcos(5x))^2=C$

Where do I go from here?

In your expression involving $\frac {25}2g^2+\frac 12 g'^2=C$ you can set $x=0$ to determine the constant (this is where the bit you have been given is important). Then you have the sum of two squares equal to [?].

Note: you get the first part - the values of $A$ and $B$ from the values of $f(0)$ and $f'(0)$ if these are given, because $f(0)=g(0)+A$ so you want $A=f(0)$ and $f'(0)=g'(0)+5B$ so that $B=\frac 15 f'(0)$. Hence you can always find $A$ and $B$ which work.
If the initial conditions are given by the values of $f(x)$ at two distinct values of $x$ you get $A$ and $B$ by solving a couple of simultaneous equations.
Once you have filled in the details, this gives a proof that all the solutions of the original equation are of the requisite form, and justifies using that form to find solutions without replicating the proof every time.
