Your logic doesn't make any sense to me.
!= means not equal to
Anyway, I would do it this way:
Code:
<img src="images/sex_<if condition="$post['field11'] == 'Female'">f<else />m</if><if condition="$onlinestatus == 1">_on</if>.gif" border="0" alt="" />
May need to wrap the whole thing in another condition to see if they entered a gender or not... but that is easy.