of course you don't have to accept a used mattress.
While the retailer has the choice of repair, replacement or refund he can only repair if the repair is perfect and doesn't disadvantage the consumer... he can only replace if the replacement is fit for purpose.. if his original mattress is not fit for purpose then he can hardly replace it for another of the same type. He can refund in any case, but he can't substitute second hand goods for new goods.
But you have probably paid him already.. so it may be hard to get the problem fixed. If the mattress was pretty cheap then there'd be an expectation that it wouldn't be as good as a more expensive version.. but it should still be fit for purpose, but it could probably be argued that a cheap mattress is fit for purpose even if it sags, or is uncomfortable.
I'd just try to get a new mattress off him, and I'd consider myself lucky if I managed it. You may have to accept the used mattress, especially if only slightly used (for display perhaps).. unless you'd be happy with no mattress and a long battle with the shop.