Connecting the Sharp IR Sensor
The Sharp IR sensor has 3 connections:
- Power (5V)
- Signal (analog output)
Unlike the Lego products, which use Lego's own wire jack, the Sharp IR Sensor uses a type of connection is called a JST (Japanese Solderless Terminal). Unfortunately, the JST can't be plugged directly into the breadboard without a JST wire adapter. You can find these adaptors online at places like sparkfun.com. 
Making the Connections
Connecting the JST to the sensor
First connect the JST connector to the Sharp IR sensor, and put the three wires on the other end of the connector into the breadboard
Adding the resistor
Since we need the resistor to get the right values out of the Sharp IR sensor, we should add it now. We're using a 10KΩ resistor, color code "Brown-Black-Orange".
Adding the wires
Finally, we add the wires in, and the Sharp IR sensor is ready to go! Remember that the connector to the resistor will need to be grounded in addition to the IR sensor's ground.
Mounting the IR Sensor
In order for the Sharp IR sensor to perform its function in this section, we must remove the ultrasonic sensor, and create a rig something like the one below in its place.
The 4x1 Lego brick fits perfectly into the back of the Sharp IR sensor if you put it in diagonally and slide it up to the top, like so:
(You may want to secure the IR sensor to the brick with a piece of tape or something of that nature)
Then simply remove the axle and connector pegs and attach them to the robot about where the Ultrasonic sensor was
Then just attach the IR sensor, and you are all set.