There appears to be a long standing insect infestation, possiby whitefly (does anything rise up and fly about when you go near or disturb the plant?) or scale infestation of some sort. The leaves look somewhat sticky, they're unhealthy with evidence of damage on the stems as well - there are white dots on the upper surface of the leaves and I think there are some on a few stems as well, but the photo doesn't magnify well, it blurs, so impossible to decide quite what they are. You might check beneath the leaves and inspect all stems thoroughly to see if you see any scale, but if you find touching the plant causes a rising up and flying about of whatever this pest is, its likely one of the aphids like whitefly.
The soil the plant is growing in looks pretty wet, and yes, there is fungus growth around the base of the stem as well as on the soil. It's possible the plant has been infested for so long that honeydew has deposited on the soil and the fungal growth is associated with that, but I'm not convinced that's the explanation. I wonder where this plant is growing, indoors or out? and how old is this plant?
If its whitefly infestation, that can be difficult to treat unless its in a greenhouse, but there is information here http://www.thechilliking.com/whitefly-infestations-on-chilli-plants/, though its mostly aimed at greenhouse growing, which is where whitefly is the most prevalent.
Depending how old your plant is, given its in such poor condition, you might want to decide to bin it - if not, then I'd remove it from its current pot and compost, wash and sterilize the pot or use a new, clean one, and repot the plant in new potting compost, then try to tackle the insect infestation - cutting the plant back by half might help.
UPDATE: If you've had to bring it indoors, then you obviously don't have a warm sub tropical or tropical climate where you are, where some chili varieties can go on for longer and be quite healthy, see here http://www.homegrown-peppers.com/growing-peppers/how-long-do-pepper-plants-live/
As the plant is two years old and is in a poorly state, you might want to consider disposing of it instead.