$\ln(x^2)$ vs. $2\ln(x)$
The function $f(x)$ has as domain $x\ne0$, $g(x)$ has $x>0$ as domain so they are different. In fact $\ln(-4)^2$ exists for the first function, not for the second one $2\ln(-4)=???$. You can transform the first function in $2\ln|x|$, but you must pay attention to put the absolute value so that the domain remains the same!
$\ln x^2 = 2 \ln \vert x \vert$
The logarithm of a negative number requires delving into the land of complex numbers. See here.
It turns out that $2\operatorname{Log}(-5) = 2\ln 5 +\pi i$ for the so-called principal branch of the complex logarithm, which is a good thing to Google if you're interested.
$\ln(x)$ domain is $\mathbb{R}^+$, so any function used as its argument must not have a range that exceeds $\mathbb{R}^+$. $x^2$'s range $\mathbb{R}^+$, whereas $x$'s range is $\mathbb{R}$.