Using I2C: Master Reader and Writer
int n = wire.read();


"Wire" should be capitalized.

Amplifying on Ken's reply, you have two variables called "n", and the global one should be declared volatile. Also, I2C deals in bytes, not ints, so preferably do this:

#include &lt;Wire.h&gt;

void setup()
{
  Wire.begin(2);                
  Wire.onRequest(requestEvents);
  Wire.onReceive(receiveEvents);
}

void loop(){}

volatile byte n = 0;

void requestEvents()
{
  Wire.write(n);
}

void receiveEvents(int howMany)
{  
  n = Wire.read();
}


In addition, the address 2 is a reserved address. 


  Address 0 is reserved as a "broadcast" address, addresses 1 to 7 are reserved for other purposes, and addresses 120 to 127 are reserved for future use.


You should choose an address in the range 8 to 119.

Reference


I2C - Two-Wire Peripheral Interface - for Arduino
Official I2C specification