My 5 year old has a cough and now ear ache. Does that mean its an ear infection?

Maybe,maybe not. Sometimes a kid with a cough & congestion can develop pressure behind the ear drum by simple fluid accumulation. An exam would be required to decide if it were infected.