The number of real roots of the equation $5+|2^x-1|=2^x(2^x-2)$ I'm trying to find the number of real roots of the equation $5+|2^x-1|=2^x(2^x-2)$.
Let $2^x=a$
$$|a-1|=a^2-2a-5$$
Then there are two cases 
$$a-1=a^2-2a-5$$
And $$a-1=-a^2+2a+5$$
Solving both equations 
$$a=1,-4,-2,3$$
Now -4 and -2 can be neglected so there are two values 
1 and 3.
Then $$2^x=1$$
$$x=0$$
And $$2^x=3$$
$$x=\log_2 3$$
But the answer doesn’t seem to consider the $\log_2 3$ as a viable root, and the answer is 1. Why is that the case?


Then there are two cases 
  $$a-1=a^2-2a-5$$
$$a-1=-a^2+2a+5$$
Solving both equations 
  $$a=1,-4,-2,3$$

You made a small mistake in solving these.
The first equation is $a^2 - 3a - 4 = 0$, so $(a - 4)(a + 1) = 0$, so $a = 4$ or $a = -1$.
Looks like you solved the second equation correctly. You should have
$$
a = -1, 4, -2, 3
$$

But the answer doesn’t seem to consider the $\log_2 3$ as a viable root

Once we have found the values of $a$ that work, we're not done yet!
We have to plug in the values to the original equation to see if they work. The problem is that $|a - 1| = a - 1$ only if $a \ge 1$, and $|a - 1| = -(a - 1)$ only if $a \le 1$, so we might have introduced some "extraneous" answers that are not valid.
As you observed, since $a = 2^x$, $a$ has to be positive; so we are left with just $a = 3$ and $a = 4$ as possibilities.
Next, we have to plug in each to the original equation to see if they work.
$a = 4$ works, but $a = 3$ doesn't. So the only answer is
$$
a = 4 \implies 2^x = 2 \implies \boxed{x = 2}.
$$
