There is hereby established by the fire authority of the county, having jurisdiction, a fire prevention officer under the direction of the fire authority. The function of this officer shall be to inspect all buildings and premises as often as may be necessary for the purpose of ascertaining and causing to be corrected any conditions which could cause fire, endanger life from fire, or any violations of the provisions of this and any other laws affecting fire safety.