You asked:

is pencil a pure substance

No. Pencil is not a chemical compound.
pencil
pencil
pencil

chemical compound
chemical compound
chemical compound