Notice, before proceeding, that we must have cosx != 0 due to the presence of 2/cosx in the equation.
cosx-1 = 2/cosx
=> cosx(cosx-1) = cosx(2/cosx)
=> cos^2x - cosx = 2
=> cos^2x - cosx - 2 = 0
=> (cosx+1)(cosx-2) = 0
=> cosx = -1 or cosx = 2
As |cosx|<=1 for x in RR, cosx=2 has no real solutions. Thus we are left with cosx=-1 as the only option.
cosx = -1
=> x = pi+2pin, n in ZZ.
As we have the restriction x in (0, 2pi), the only choice for n which works is n=0. Thus we get our solution:
x = pi
Checking, we find that it satisfies the given equation and does not violate the restriction of cosx != 0 we set in the beginning, as desired.