Using WordPress as a CMS (content management system), this would be relatively straight-forward. Just remember, straight-forward does not mean “easy” …
Custom Post Types
One of the newest and best features of WordPress is custom post types. Rather than using a traditional post or page, I would make two kinds of custom post types – one for questions and one for answers. Obviously the question will have titles, tags, and content. The answers will just have content.
I’d also add a custom meta value to each answer to tie it to a specific question.
Both questions and answers can have comments, which works well with the existing framework
Voting
There are several different voting plug-ins available, though none really handles the meritocracy system that SO has built up. Still, any plug-in that allows you to rate a question/answer will be a good place to start. With some minor tweaking you could get it working like the up/down voting system of SO.
Meritocracy
Each user account would have to have a custom field associated with the user’s reputation. This would be modified directly by the up/down vote plug-in.
Other features
The rest of the UI would be entirely up to you – it could either mirror SO completely or take on its own format. Really, once you have questions and answers presented and persisted in the database correctly, the sky’s the limit.