In addition to the answer by @Dave, I will give an example showing that a deterministic (or one-to-one) relationship is not always possible. I will use a categorical data example, so the joint distribution can be given by a two-way table. But first, one formula for the mutual information is
$$ I(X, Y) = H(X) + H(Y) - H(X, Y) $$
where $H$ is the Shannon entropy, with one argument the marginal, with two arguments the joint. If $X, Y$ are independent, then $H(X,Y)= H(X)+H(Y)$, so then the mutual information is zero, the minimum possible value.
But you ask for maximizing mutual information, so intuitively, to go as far away from independence as possible. And we cannot get further away from independence than a one-to-one relationship. So, to maximize mutual information (say, with the two marginals given) we must minimize $H(X, Y)$.
First, one example where a 1-1 relationship is possible:
This shows only the two marginals. There are multiple joints that fulfills the conditions, just fill in two 0.5, two 0, with one 0 in each row and each column. Then an example where it is impossibe to fill in a solution which is 1-1:
|
0.2 |
0.2 |
0.2 |
0.2 |
0.2 |
0.4 |
|
|
|
|
|
0.6 |
|
|
|
|
|