My iPhone won't shut down
Are you saying that the sleep/wake (top-most) button is not functioning/responding?  If so, you can access Assistive Touch in the iOS settings to give yourself a touchscreen method of mimicking many of the iPhone's hardware buttons.