Do I need to keep all blocks, from block 0 up to the current one, when running Bitcoin Core, either as a full node or not? Or can I just keep the more recent blocks to save space?
Full nodes keep all blocks by default, but this is not necessary to achieve full node security. Full nodes validate the complete blockchain and enforce all consensus rules regardless of whether a full history is kept.
Keeping all blocks is a service to the network, as you'll be able to provide all blocks for synchronizing nodes or requests of thin clients.
If keeping the full blockchain is a problem, you can reduce the storage-footprint by running Bitcoin Core in pruning mode. Just add
prune=<n> to your
<n> is the amount of youngest blocks you want to keep in terms of mebibytes storage. The minimum is 550 MiB.
This is called pruning.
Since Bitcoin-Core 0.11.0 you can prune (trim) the blockchain in Bitcoin-Qt. But not from the UI. You need to add
-prune=550to your bitcoin.conf file and restart Bitcoin-Qt.
-prune=<target in MiB>will tell bitcoin-core to remove blocks which are older than oldest block that can be kept with a chainsize (sum of block-sizes) of
<target>(min. 550MiB as example above shows). A minimum of 550MiB ensures to keep at least 288 blocks (~2 days). (simple explanation not including undo-data)
-prunedoes disable all wallet functions in version 0.11 (will work with a wallet in version 0.12).
Obviously, as a full node you can't serve historical blocks you don't have, so you're more like a P2P leecher.