Both employees and the self-employed qualify for the state pension. If you are self employed and have been paying PRSI at the S rate all your working life you will be entitled to the state pension when you reach 66. You do not have to retire to claim it.
However, self-employed individuals need to check their PRSI payment status where they incur losses as for any year that they have a loss they will not have made any PRSI payment. To ensure that they make a PRSI payment for the year an election to make voluntary PRSI payments for the year in which a loss is incurred should be made.
It is important to do this as soon as possible after the year for when a loss arose as a two year time limit may be applied. This is dealt with the relevant section in Social Welfare and is dealt with outside of the normal tax payment system.
If you are married and your spouse assists in running the business then you should ensure that they receive payment for doing so, and then they will also qualify for the contributory pension at age 66. If you are a sole trader they need to be treated as a partner in the business and pay PRSI under Class S.
For sole traders entering partnership with your spouse could have other tax implications which would need to be examined. However with careful planning this should not be a major issue. In fact it will save you tax under the individualization rules. Your spouse at age 66 should have full entitlement to a contributory pension at no extra cost to you. There will be no extra PRSI cost as the same amount of income will be liable for PRSI regardless of whether you are a sole trader or a partnership. The same position can be achieved if you carry on business through a limited company. However your spouse will be treated as a normal employee for PRSI purposes. Your spouse will qualify for the contributory pension at no extra cost.