While Kilted Tim is correct you should be able to view the carrier in settings > general > about if you can get to those screen (not in ios setup) if not then Kilted Tim is absolutely correct. Call Apple give them your serial number and they will tell you whether it is unlocked and if not who it is locked to. After which you should contact that carrier to get it unlocked.
I bought an Unlocked Iphone from somebody and it is Factory unloicked but it says " SIm not valid"
I have verfied that is indeed unlocked by usuing an internet check, i can't remember the details of the check but it had me type in my model number i believe. And it says the Iphone is unlocked.
There is no "interent check" that can tell you whether your phone is locked or unlocked. The sites that claim to do this are all scams. Only Apple can tell you the lock status. But your symptom says that your phone is locked to some carrier.