Inflation and dark energy arising from geometrical tachyons