Yes, this can be accomplished with a single transistor and resistor, but there are chips specifically designed to invert digital signals. Oddly enough, they are called inverters. Check out the 74HC04, for example. That gives you six separate inverters in a single 14 pin package. There are also single inverters (and other small logic gates) available in small SOT-23 packages, which is the same package individual transistors come in.
There is little reason to try to make your own inverter, but yes, it is possible.
Added in response to comment:
As I said, a single bipolar transistor can be used as the basis for a simple inverter. At minimum, you need the transistor and a base resistor. For completeness I'll also add a output load resistor, which you should assume is needed unless you know whatever will be connected to the output will provide the necessary load. There is nothing magic about a PNP transistor in particular. A NPN can be used just as well. Here is how each would be used:
Note that each has 4 connections: power, ground, input, and output. The difference between the two is which direction it loads the input and which direction the output is actively driven versus passively pulled by the load. If you don't care about these issues, then the two circuits are functionally equivalent.
However, this is easier:
It's also faster, takes less steady state power, has higher imput impedance, and is smaller. It has the same four connections the inverters above do. Single gates like this are available in SOT-23 packages, which is the same package single transistors come in. This only requires one external part, the bypass cap. It doesn't need a load resistor since its output actively drives both ways.
Really, for general inverting of digital signals, making your own inverter is silly for normal applications.
Off topic aside about schematic drawing:
The script is really just three lines. Here is the whole file:
rem Creates a nicely filtered schematic GIF file from the raw Eagle output
rem /temp/a.tif. The resulting GIF file will be /temp/b.gif, and will be
rem gray scale.
image_filter /temp/a.tif /temp/b.img -shrink 5
image_copy /temp/b.img /temp/b.gif -form -gray
image_disp /temp/b.gif -zoom 1 -dev medium
It's a very specific one-off script, but works well enough for the purpose. In Eagle I export the schematic to image file \temp\a.tif, run the script which makes \temp\b.gif. The Eagle setting for image export are 600 DPI and monochrome. Really, that's all there is to it. It probably sound more complicated than it is.