I understand how both graphs are drawn, but I do not understand why you cannot just convert one into another. It feels natural to me to just convert $2\log x$ to $\log x^2$ and not have to worry about the domain restriction.
2 Answers
The wonderful thing about math is that you don't have to rely on your feelings to get the right answer.
You have two functions $$ f(x) = 2\log(x) \\ g(x) = \log(x^2) $$ Indeed for $x > 0$ you have $f(x) = g(x)$. Both functions aren't defined for $x=0$. The domain of $f$ is all positive real numbers, but the domain of $g$ also contain the negative numbers. So the two functions aren't equal.
It is possible that you entered the functions wrong on your calculator. You might have entered $\log(x^2)$ as $(\log(x))^2$ and in this case you obviously get something different. So make sure you have the right parentheses.

- 43,555
$\begin{array}lf: &\mathbb{R}^*_+&\to \mathbb{R}\\&x&\to 2\log x\end{array} \quad \implies2\log x=\log x^2$
$\begin{array}lg: &\mathbb{R}\backslash\{0\}&\to \mathbb{R}\\&x&\to \log x^2\end{array} \quad \implies\log x^2=2\log |x|$

- 1,690
It feels natural to ... not have to worry about the domain restriction
Natural or not, that's the wrong approach here and in general. – dxiv Aug 09 '17 at 01:40