Thought I'd do a kinda how to post for changing the sensor.
Easy enough job! Takes about 1 hour.
Tools required: new sensor - recommend the denso one - £112 from import car parts, ramps, screwdriver, 22mm combination spanner, 12mm socket & extension bar, diagnostic reader for clearing codes - I used dashcommand app and wifi OBD2 plugin
EML & code P0031 - meaning sensor in headers needs replacing
Put car on ramps and remove plastic guard under engine, 4-off 12mm head bolts to remove and 4-off plastic clips with a screwdriver! Good practice to put a bit of copper slip on the bolt threads on reassembly as these have a habit of snapping!
Sensor is located on drivers side exhaust header, there is also a removable flap in drivers side wheel arch to gain access.
Sensor needs to be unplugged to allow spanner to fit on, follow wire up and it plugs in in front of drivers side strut, unplug and feed wire to the underside, feed wire through the ring end of 22mm spanner and feed the spanner onto the sensor, right hand thread so pull towards the front of the car to undo - can be tight!
Check the new one is the same, be carful with the new one and don't let wires kink, I fed wire through the removable panel in arch and helped wire twist while screwing new sensor in
When happy new sensor is tight remove spanner and feed the wire up to the plug and plug in, make sure the wire is secure on the chassis with the supplied clips as you don't want it rattling about!
Put plastic engine guard back on
It's now time to clear codes and job done
Hope this is some help, I have changed one of these on a bug wrx too but had to remove the lower part of the heat shield on the header to allow access with a spanner, bit more fiddley but otherwise the same.