The attached document has the mechanism for the dehydration (I assume that is what you meant by how).
As for why you use IR, it is just for verification. Yes, you could assume that it is cyclohexene, but it's a lab, you're meant to gain experience with different instrumentation.