Answer
Wa `alaykum As-Salamu waRahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
There is no problem to pay a person’s attention by raising your finger to the heavens to remind him of Allah or to encourage him to recite the shahadah immediately before his death.
Answering your question, Dr. Mohammad S. Alrahawan, Associate Professor at the department of Islamic Studies in English, Al-Azhar University, Egypt, states:
Extending finger during prayer: A Must?
Extending finger during prayer is not agreed upon by all scholars. Shafi`i scholars, for example, recommend that one raises his finger when he mentions the name of Allah. Other scholars recommended that one keeps moving them.
They have also disagreed on the wisdom behind raising one finger whether it is in reference to Allah or it is to show that one is engaged in prayer so that people do not pass in front of him.
Pointing index finger to say shahadah in Deathbed
Anyhow, if raising your hand in the presence of a sick person is for reminding him of reciting the testimony of faith, there is no problem. We have been commanded by the Prophet Muhammad (peace be upon him) to “Exhort our dying men to recite: ‘La ilahaillallah‘ (There is no true god except Allah).” (Muslim)
First, a person may recite it in his presence so that he is encouraged to repeat it after him. In certain cases, a sick person may not be able to hear but he can watch people around him. He may also feel angry when people insist on exhorting him to say shahadah.
Imam An-Nawawi stated that a sick person may be persuaded to say shahadah several times. He may, in this case, dislike this practice and may utter inappropriate words while being on the verge of death.
Therefore, people may give him implicit indications in order to remind him to recite the shahadah (An-Nawawi, Sharh Sahih Muslim, vol. 7, p. 219)
Therefore, there is no problem to pay a person’s attention by raising your finger to the heavens to remind him of Allah or to encourage him to recite the shahadah immediately before his death.
Allah Almighty knows best.