Former Iranian President Ahmadinejad makes his first public appearance in months at Khamenei's funeral.