A direct approach: use the unit-circle definition of sine and cosine.
Consider a unit circle around the origin of a Cartesian plane.
Since in this problem $x$ is already in use as an angle,
we cannot label the two axes $x$ and $y$ as usual, so let's label them
$u$ (on the horizontal axis) and $v$ (on the vertical axis) instead.
Then the unit-circle definition says that if we take a point at an angle
$x$ radians counterclockwise around the unit circle, the coordinates
at that point will be
\begin{align}
u &= \cos x, \\
v &= \sin x.
\end{align}
The equation $\cos x = \sin x$ then tells us that $u = v$,
which is the equation of a line at $\frac\pi4$ radians ($45$ degrees)
through the origin.
But we got these coordinates in the first place as coordinates of a point
on the unit circle, so the solution must be at a point where the
line $u = v$ intersects the unit circle.
Draw a graph, as in the figure below: there are two such points.
The coordinates of these points happen to be
$\left(\frac{\sqrt2}{2},\frac{\sqrt2}{2}\right)$
and $\left(-\frac{\sqrt2}{2},-\frac{\sqrt2}{2}\right)$,
but even without figuring that out, since you know the angle of the line
$u=v$ you can easily see the two possible values of
$x$ within the range $0$ to $2\pi$ radians ($0$ to $360$ degrees).