Is there any elementary way to show that $\ln (x)^2+2(x-1)\ln x-3x+1=0$ has $2$ real solutions on $(0,\infty)$?
I did it by this way.
Let $f(x)=(\ln x)^2+2(x-1)(\ln x)-3x+1$.
signs of $f(\frac{1}{2})$, $f(1)$, $f(e^2)$ are $+$, $-$, $+$ since $f(x)$ is continuous, due to this changes in sign there should be at least two roots for $f(x)=0$.
I want to know if there's any nicer way to do this.
As you have already noticed, you have shown that at least $2$ real solutions exist, to show that only 2 real solutions exist we can use that
$$(\ln(x))^2+2(x-1)(\ln x)-3x+1=0 $$
$$\iff \ln x=\frac{-2(x-1)\pm\sqrt{4(x-1)^2-4(-3x+1)}}{2}$$
$$\iff \ln x =(1-x)\pm\sqrt{x^2+x}$$
and then, by derivation, show that functions $g(x)=(1-x)+\sqrt{x^2+x}$ and $h(x)=(1-x)-\sqrt{x^2+x}\,$ for $x>0$ are monotonic, respectevely increasing and decreasing, and from here conclude for the existence of only $2$ real solutions, invoking IVT and using that $\log x$ is monotonic itself and surjective onto $\mathbb R$.