Graphite, the stuff in a pencil, is formed from carbon atoms arranged in a honeycomb pattern. These honeycomb layers are stacked one above the other. A single sheet of graphite is very stable, strong, and flexible. Since a single sheet is so stable by itself, it binds only weakly to the neighboring sheets. This explains why graphite is used in pencils: as you write, you rub off tiny flakes of graphite.
Although the individual flakes are very strong and flexible, the graphite used in a pencil is weak, since the flakes can easily slide relative to each other. In carbon fibers, the individual layers of graphite are much larger and form a long, thin winding spiral pattern. These fibers can be stuck together in an epoxy, forming an extremely strong, light (and expensive) composite used in aircraft, tennis rackets, racing bicycles, racecar suspensions, etc. There is another way of arranging the sheets which is even stronger. Imagine wrapping the honeycomb pattern back on top of itself and joining the edges. You have formed a tube of graphite, a carbon nanotube.
These nanotubes are the strongest fibers known. A single perfect nanotube is about 10 to 100 times stronger than steel per unit weight.
Not only are carbon nanotubes extremely strong, but they have very interesting electrical properties. A single graphite sheet is a semimetal, which means that it has properties intermediate between semiconductors (like the silicon in computer chips, where electrons have restricted motion) and metals (like the copper used in wires, where electrons can move freely). When a graphite sheet is rolled into a nanotube, not only do the carbon atoms have to line up around the circumference of the tube, but the quantum mechanical wavefunctions of the electrons must also match up. Remember, in quantum mechanics the electrons are smeared out; in a nanotube this electron smear must match up when going once around the tube. This matching requirement restricts the types of wavefunctions that the electrons can have, which then affects the motion of the electrons. Depending on exactly how the tube is rolled up, the nanotube can be either a semiconductor or a metal.
In fact, if there is a special kind of defect in the honeycomb pattern of a nanotube, a single nanotube can change from being a semiconductor to being a metal as one travels along its length. This forms a Shottky barrier, a fundamental component of electrical devices.