Sounds like your iPhone was hacked to unofficially unlock it. You can put it in Recovery mode, connect it to iTunes and Restore it in iTunes. Then you will need to call AppleCare, give them the model and serial numbers and find out which cell provider it is locked to. After you get that information contact that cell provider and see if you can get it officially unlocked.