You have correctly identified why the stupid ‘do you even RSA, bro‽’ cryptosystem is trivially vulnerable to forgery and/or decryption by an adversary if you naively use the same key for naive encryption and naive signature—although it doesn't apply in a single instance: you use your private key to sign a ‘message’, and your friend's public key to encrypt it. But if someone can get you to sign a ‘message’ which is actually an encrypted message to you, they have just got you to decrypt the message for them.
This is why nobody in their right mind who takes the time to listen to cryptographers actually uses this stupid cryptosystem. Unfortunately, many textbook authors document this stupid cryptosystem and call it ‘RSA’ and leave it at that. This is why some people use the insufficiently derisive term ‘textbook RSA’.
What you should do instead is use independent keys for RSA-based signature and encryption, and use them in sensible RSA-based cryptosystems.
The post I linked to summarizes some alternative modern RSA-based cryptosystems. In another answer, I summarized in simple terms a modern RSA-based signature scheme called RSA-FDH.
These may even be safe to use with the same key, as long as you choose independent hash functions for the signature scheme and for the signature scheme—however, I'm not aware of a security reduction to the RSA problem for the use of the same key in any pair of sensible RSA-based encryption scheme and signature scheme. So I recommend using independent keys, just to be on the safe side.
Or don't use RSA at all, because securely composing signature and encryption into authenticated-encryption is hard (archived), and additionally leaks verifiability to third parties, which may or may not be what you want. Instead, consider using a NaCl crypto_box_curve25519xsalsa20poly1305
.