The device you are talking about is called a transponder .
This is a device that listens for a signal (an interrogation) and responds with information about the airplane including an ATC assigned code, altitude information and additional aircraft info for certain equipment.
There are 2 ways ATC watches airplanes: Primary Radar Secondary Surveillance Radar
The transponder is interrogated by the Secondary radar and the response is listened for.
Even with no transponder, the aircraft can still be tracked by primary radar.
This is just a normal radar that is good at seeing airplane sized objects and not so great at seeing weather and can occasionally spot a large flock of birds.
The primary radar is what provides the "blip" on radar and tracks the airplane.
The datablock ATC has on the airplane comes from the secondary, so what ATC will see is a blip with no information.
Turning off the transponder is as simple as setting it to OFF or pulling a circuit breaker and yes, it can be selected OFF in flight, it is just a switch.
The problem with radar is that it only works so far from a radar transmitter and the further away
you are the higher
you must be to be seen by the radar.
Over the ocean away from land, you are going to be on the fringe of radar or out of radar contact completely and thus unable to be tracked directly by ATC (at this point, non-radar procedures such as position reporting and ETAs can be used to track positions).
The flight in question was apparently visible by a military radar before it disappeared from the scopes (it allegedly observed what appeared to be a turn back toward its origin).
aviation.stackexchange.com/users/258/casey
With the proper knowledge of the aircraft systems almost anything can be turned off.
That's what we do at the end of almost every flight day.
Most of the communications systems can actually be turned off fairly easily, but the average person would not know how to do it.
In airplanes like the 777, there are multiple ways that they communicate but all of them can be turned off (transponders, ACARS reports, CPDLC, ADS-B, radios, satellite phones, etc.).
Some are automatic and some are manual, and not all aircraft have all of them.
Most of them have a switch or can be controlled through the Flight Management System, but the ones that don't will have a circuit breaker designed to protect the system which may be pulled in order to deactivate the system.
aviation.stackexchange.com/users/69/Lnafziger
As a B-737 pilot, I can tell you that ALL electrical components are wired into the electrical system to a specific electrical BUS.
It would not be hard to determine which BUS(S) run power to the associated component and therefore knowing which circuit breaker(s) to pull.
The ACARS that transmits our FOQA information can be disconnected on the BBJ I fly.
I assume it can be done in the B-777.
aviation.stackexchange.com/users/1382/Kip Fuller
With today's locked cockpit policy it is extremely unlikely that hijackers would be able to turn off the transponder without pilots being able to set it to 7500, the code for unlawful interference, for at least a short while.
Because while the transponder can be turned off, the hijackers would have to get into the cockpit first.
The cockpit door can't be opened from cabin side.
Even if the stronger code is entered that will open the door (for cases when one pilot is incapacitated while the other is in the lavatory) the pilots still have some time to cancel the unlock request.
Therefore the hijackers would have to threaten with something to get the pilots unlock, but that would give the pilots time to provide some indication of the hijack to the ATC.
aviation.stackexchange.com/users/524/Jan Hudec
Another Boeing 777 on 12th July 2014 suffered smoke in the cockpit and cascading loss of electrical systems, navigation displays and Comms in the cockpit.
That was Continental Flight 201 which made an emergency landing on Midway island.
There are disputed claims that flight 201's transponder also failed during the emergency.
In the case of MH370 it is acknowledged that the ACARS suffered a power interruption prior to log-on requests.
It seems possible that the transponder was affected by whatever power interruption the ACARS suffered therefore it is not an automatic assumption that the transponder and ACARS were turned off deliberately.
aviation.stackexchange.com/users/2357/user2357
The plane's position is reported by ACARS and by the transponder.
MH370 lost ... ... its Mode S transponder (shortly before 17:20:33 UTC) ... ACARS (somewhere between 17:07:49 - 17:37:29 UTC) ... and the SDU (somewhere between 17:07:49 - 17:37:29 UTC).
The SDU was repowered, however, at 18:25:27 UTC, when it logged onto theInmarsat satellite network again.
The first 2 items can be easily disabled in the cockpit.
The SDU can be disabled by either turning off the AES circuit breaker in the E&E bay or depowering the left main AC bus in the cockpit (which results in the collateral loss of various systems).
India has made it mandatory for aircraft flown by Indian operators to install a device reporting the aircraft's location every 15 minutes, thereby preventing the aircraft from disappearing:
India makes its aircraft disappearance proof post MH370 incident «
India has taken several steps to remove any possibility of the aircraft operated by its airlines disappearing without a trace in the aftermath of the shocking incident in March 2014 involving Malysia Airlines’ MH370.
It has made it mandatory for aircraft flown by Indian operators having a seating capacity of 19 passengers or takeoff weight of 45 tonnes or more to install a devise that will send location of the aircraft at 15 minute intervals.
The government had ordered airline companies to compulsorily install an automated aircraft tracking system (ATS) in all aircraft falling in the above categories.
The system will pass location information to ground stations even if the aircraft is flying over the oceans during long international flights throughout the duration of the flight.
» ( source )
aviation.stackexchange.com/users/22550/summerrain
I was speaking to someone about the  MH370 incident , and they suggested that a hijacker could turn off the device that sends the plane's current position, resulting in the appearance of a catastrophic midair failure.  I assume that such functionality could not be turned off, but I could be wrong. Is there any way that this could be done? Could an aircraft's internal tracking systems be "turned off" midair, and also not be located by external tracking like radar?
Is it possible for a modern commercial airliner to stop being tracked without substantial mechanical failure?
aviation.stackexchange.com
<avionics><radar><mh370-incident><gnss>
aviation.stackexchange.com/questions/2160
aviation.stackexchange.com/users/1351/andrewb
The device you are talking about is called a  transponder. The plane's position is reported by ACARS and by the transponder.  With the proper knowledge of the aircraft systems almost anything can be turned off.   The transponder reports the position of the aircraft, this can be disabled from the cockpit. However the plane can still be tracked by normal radar.
Users provide information on the operation of transponders in aircraft