and Bz(x)=0 otherwise.

I have to write down an expression for the wave function corresponding to stationary states, of particles with spin either parallel or antiparallel to the z-axis.

What I've come up with so far is (Ae^(ikx)+Be^(-ikx))

but I'm actually quite lost in this problem. Could someone please give me a hint how to solve this problem?