and finally x=(pi*n)/2 +(-1)^n *pi/4
however the correct solution was x=n*pi + pi/4
The answers are basically equivalent, try n=0 and n=1 in your solution and you get:
x=(pi*0)/2 +(-1)^0 *pi/4 = pi/4
and
x=(pi*1)/2 +(-1)^1 *pi/4 = pi/2 - pi/4 = pi/4
and if you try n=0 in the correct solution you get:
x=0*pi + pi/4 = pi/4
if you then tried 2, 3 in your solution and 1 in their solution you'd get the same answers again
what's the reason? well your basic angle was pi/2, and normally you'd have to find the
other angle that gives you the same sine value by subtracting pi/2 from pi, but in the special case where pi=1 (or in fact -1), that
other angle is the same angle! there's only one angle that gives you sin(angle) = 1 in each cycle, whereas normally (for any other angle) there is a second in quadrant 2 (or two in quadrant 3 and 4 for negative values, with the exception that there's only one angle that gives you -1)
because of that, we can literally say 2x = pi/2 + n*2pi because we have our one angle and then we'll just add 2pi again and again, n times, to get solutions from other cycles
divide by 2 and you get x = pi/4 + npi which is the answer
it's always possible that the answer you get will appear to not be a solution to a multiple choice question, in that case you need to look at the solutions that are there and see if any are equivalent to your answer. (or look at your answer and see if it's the same as anything there)