“Who are you pregnant by?” or
“By whom are you pregnant?”
What is the best way of asking about the father of the child?
English Language Learners Stack Exchange is a question and answer site for speakers of other languages learning English. It only takes a minute to sign up.Sign up to join this community
Grammatically speaking, the “by whom” example is the so-called correct, formal one. However, the “who” example is the usual way people speak.
However, asking about paternity is a very touchy subject. You could easily offend the mother by asking this. In particular, your examples seem rather crude to me. If you think it is safe to talk about it, I think there are more idiomatic ways to ask. For example
Who is the father?
Who's the dad/daddy? (Casual)
If you insist on using a verb related to “pregnancy”, you could use impregnate
Who impregnated you?
2 Make (a woman or female animal) pregnant.
‘he was obliged to marry the woman he'd impregnated’
This is sounds rather forward and formal.