My iPhone 5 top button isn't working?

I have an iPhone 5 and the top button doesn't always respond immediately, it sometimes takes 3 or 4 tries to get it to work, and it is really annoying. What should I do? Will apple replace it for me or no?

Settings>general>accessibility>turn in additive touch. You can lock your screen using that

If you have an iPhone 5, its still under the 1 year warranty so yes, they will replace it for free. Just back up all your information and make an appointment.