Identifying the correct source of packets I have a basic question regarding digital communication , especially pertaining to wireless internet . 

A packet is basically a stream of bits . And a bit is detected as zero or 1 depending on whether the amplitude of a signal of certain frequency is crossing a threshold or not . 
Now suppose a particular host or source $ A $ is sending this signals at a frequency $\ f $  to a receiver $ R $
Then it is possible that some device , $ B$ near the receiver can be placed to detect the frequency and regenerate a signal in that frequency and direct it towards the receiver . 

In internet communication , I guess the packets will definitely be containing information about the source IP address, the IP of $ A $  but $ B $ can alter the bits so as to insert send its own IP  address in the packets . 

In such situations , how do real receivers , identify the correct source ?
This is a very broad topic, and a full answer requires a few textbook chapters. A few pointers:


This problem is not solved in the physical layer; in other words, don't think in terms of frequencies, bits and packets.
The physical layer can handle some problems such as multipath, error correction and detection, and synchronization. The problem you're referring to is solved in the upper layers in the stack, and the solution depends on the particular network implementation.
For example, in WiFi there is an authentication protocol that ensures (with high probability) that every received packet comes from the actual source. A man-in-the-middle wouldn't be able to generate packets that would be recognized as valid by the receiver; again, this would happen somewhere in the network stack, not at the physical layer.