The public key is used to ensure you are the owner of an address that can receive funds. The public key is also mathematically derived from your private key using elliptic curve multiplication, which is irreversible. Because the public key is derived from the private key it can be used to verify the digital signature of a transaction without divulging the private key behind that signature.
The public key is also used to generate the public address. Because the public key is such a long string, it is hashed to form a public address, which can then be provided to another person to send coins. Public keys can be regenerated if they are lost by using the private key.
Using reverse mathematics to derive the private key from the public key would take the world’s most powerful supercomputer many trillion years to crack.