Is it possible to update an iphone 3g ios 4.2.1 to ios 5?
No ,you can't update the the iOS 4.2.1 to iOS 5 in iPhone 3g.

The highest supporting operating system of iPhone 3g is iOS4.2.1.(Apple discontinued iPhone 3g on June 2010).  

If you need iOS 5 like features on your iPhone 3G, try Whitedoor(it may help you).

Note: Whitedoor is just an iOS 3.1.3 so you won't be able to run your iOS 4.0-4.2.1 applications on it, but it has a separate store with the last 3.1.3 supported versions with a lot of application.