One possible approach consists in the following steps:
- draw a buffer of 5m around points;
- dissolve the buffers which overlap;
- calculate the centroids of dissolved buffers.
You can choose the tools with which you're more comfortable.
For instance, using GDAL >= 1.10.0 compiled with SQLite and SpatiaLite you can calculate the buffer around your
ogr2ogr buffers.shp points.shp -dialect sqlite -sql "SELECT ST_Buffer(geometry,5) from points"
Then, calculate the clusters (dissolved buffers):
ogr2ogr clusters.shp buffers.shp -dialect sqlite -sql "SELECT ST_Union(geometry) from buffers" -explodecollections
ogr2ogr result_points.shp clusters.shp -dialect sqlite -sql "SELECT Centroid(geometry) FROM clusters"