Does an iPhone have to be signed to a phone service provider in order to work?

I was wondering if I were to buy a used iPhone from let's say Craigslist would I have to buy a plan for it from AT&T? I don't want to call or text anyone I just want it for the camera it has for my Instagram and possibly apps. I already have an iPod but its camera is HORRIBLE and makes my pictures grainy. So would I be able to use a used iPhone like an iPod without having to pay for a monthly plan?

You can still use the iPhone, but only on Wi-Fi. If you want date, you have to pay for a plan. You can do all the things you'd do with data, but only when you're on Wi-Fi.