Is there some **onto** function $f:$ $\mathbb{C}$ $\rightarrow$ $\mathbb{C}$
such that for each triangle $T$ (with its interior), $f(T)$ is a
square (with interior, too) ?
I would have the same question for triangles and squares *without* interior, respectively.



Triangles, squares, and discontinuous complex functions 
With interior: yes. Fix a sequence of squares $Q\_1\subset Q\_2\subset\dots$ whose union is the entire plane. Then arrange a map $g:\mathbb R\to\mathbb R^2$ such that, for every nontrivial segment $[a,b]\subset\mathbb R$, its image is one of the squares $Q\_i$. To do that, construct countably many disjoint Cantor sets so that every nontrivial interval contains at least one of them. Then send every Cantor set $K$ bijectively onto $Q\_n$ where $n$ is the minimum number such that $K\cap [-n,n]\ne\emptyset$. Send the complements of these Cantor sets to a fixed point inside $Q\_1$. Then define $f(x,y)=g(y)$.


(This is a detailed version of gowers' answer.)


UPDATE


Without interior: no. Take any triangle $T$ and consider its image $Q$ with vertices $ABCD$. There is a side $I$ of $T$ whose image has infinitely many points on (at least) two sides of $Q$. If these are opposite sides, say $AB$ and $CD$, the image of any triangle containing $I$ must stay within the strip bounded by the lines $AB$ and $CD$. And if these are two adjacent sides of $Q$, say $AB$ and $AD$, the image of any triangle containing $I$ stays within the quarter of the plane bounded by the rays $AB$ and $AD$. In both cases, the images of the triangles containing $I$ do not cover the plane, hence the map is not onto.


