From your photo:
1) Why are your feet turned out? Can you point them straight ahead? Your knees are feet should be in the same direction - both pointing straight ahead. This goes for standing and walking. Also your feet should not be rolling in which would flatten your arches.
"my knees always hurt when I walk or do any exercise and my ankels hurt too when my knees do."
Maybe they are related problems.
Look at you kneecaps. Are they pointed inwards, pointed outwards or pointed straight ahead? if they aren't pointing straight ahead, your hips are out of alignment and the muscles in your hips are not in balance.
"Also I walk funny because I don't and cant bend my knees. "
What does this mean? Your knees don't bend? You need to make a conscious effort NOT to let your knees hyperextend as you take a step and put your leg out in front of you.