What was the elephant doing on the freeway?
Q: What was the elephant doing on the freeway?
A: About 5 mph
This is an "elephant joke". Elephant jokes are not just about elephants, they also use absurd logic, and break the listener's expectations.
The critical point in this joke is that the listener originally parses the sentence as "What action was the elephant performing while on the freeway", and the punchline causes them to re-evaluate the setup to mean "what speed was the elephant going on the freeway."
The humor of this joke relies on the listener understanding the colloquial phrase "[Person] was doing [number]" to mean "[Person] was going [number] miles per hour". Eg: "I was doing 120 when the cop pulled me over" could also be said "I was driving 120 miles an hour when the cop pulled me over".