Hello,
The symptoms that you have described can be due to retronychia. It is embedding of the nail into the nail fold and subsequent inflammation. It can be associated with onycholysis i.e. detachment of the nail from the nail bed. Thyroid diseases and fungal infections have to be ruled out. It is advisable to consult a dermatologist and get examination of the nail scrapings and fungal culture done.
It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your dermatologist. I sincerely hope that helps. Take care and please do keep me posted on how you are doing.