Is ##g## a constant or a function? If I assume it is a constant, then this wave equation is applicable for an inhomogeneous media with a resonance at ##x=L##. What is the domain for this problem? Is it ##0\leq x## or is there another boundary? If there is no other boundary I'm assuming a radiation condition must apply. Also, what is the context of this problem? Finally, I see that this is listed as a "basic" thread, but in reality this problem is most suitable for advanced undergraduate or graduate students.
If you have learned about classification of partial differential equations, then you should notice that the variable coefficient changes sign at ##x=L## so the nature of the partial differential equation changes from hyperbolic for ##x<L## to elliptic for ##x>L## and therefore characteristics won't get you the solution you want.
Given that, I would either use separation of variables or simply assume harmonic time dependence. Either way you will get an ordinary differential equation with variable coefficients for the spatial variation of the solution. The solutions have different character on either side of the resonance (also called a turning point in this context) and you will need to match them. I expect there will be some subtleties here; the singularity will casue problems that are usually dealt with by adding a small amount of damping to the problem (which is partially why I asked about the context).
That should get you started, but again, this is not a basic problem.
jason