Born in Königsberg, Friedrich became the Kurfürst (Elector) of Brandenburg, in 1688, upon the death of his father Friedrich Wilhelm I. At the time, Friedrich I was known as Friedrich III. He became "Friedrich I", when he became King.
Friedrich I was never called "king of Prussia". His title was "king in Prussia": Most of Friedrich's territories were part of the "Holy Roman Empire of German Nation". And this country had a Habsburg king. For reasons of prestige (similar to Piedmont becoming the Kingdom of Sardinia) Friedrich wished to become a king instead of a mere elector-prince. However, no kingdoms could exist in the Holy Roman Empire (with the notable exception of Bohemia). Friedrich convinced the archduke of Austria (and Holy Roman Emperor) to allow him to become king of Prussia in exchange for an alliance against France. The argument was that Prussia had never belonged to the "Holy Roman Empire of German Nation" and therefore there was nothing stopping the elector-prince of Brandenburg also being King of Prussia (the Emperor himself was also King of Hungary, outside of the Empire). To indicate that Friedrich's royalty was limited to Prussia and did not reduce the rights of the Emperor in Friedrich's German territories, he had to call himself "king in Prussia".