to look at
to listen to
to leave for
The above are some verbs that use a preposition. Normally, in constructions such as yours, the preposition is placed at the end, although ending a sentence with a preposition is not preferred for some (that's probably from where you got the impression "not formal").
"The tree is what I am looking at." is correct. Alternatively, "It's the tree I'm looking at." or simply, "I'm looking at the three."
"The tree is at what I am looking." or
"Jazz music is to what I'm listening." or
"London is for what I'm leaving."
These are improper constructions, when the verb takes a preposition. With no preposition, there's no such question, as in: "This is what I'm planning."