It honestly depends. If this is you, or a friend, I would suggest to see a doctor to be sure because they are the only ones that can make a professional diagnosis and provide the best advice.
My input would be: either a coping mechanism or hallucinations.
Either way, it's nothing to be ashamed of and the sooner you seek medical advice, the sooner you can get a legitimate answer.
In the scenario that you might speak to yourself is totally fine, if i interpreted this question correctly. Some may think it as absurd, but others think of it as a way to clear your mind, and boost self-esteem. Some people who have lost a family member might talk to them if they were actually there because they long being with them and miss them. As a child, I had a friend, which was actually my brothers who i loved since he was nice and caring. He went overseas during a hard time for me and I had no one to talk to. I would imagine him being there to help me to boost myself.
Say you would want to start eating healthier. You ask your parents or whoever goes grocery shopping in your family to buy less junk food and more healthy food. You can also ask them to keep you on the right track. Since there is less junk food in your house, your family would theoretically start eating better too.
I would tell him that other foods give you vitamin A other than carrots and he probably gets the recommended amount of vitamin A without knowing it, or he could just eat another carrot if he's that worried about it.